#6 Adds new servlet aware context factory

closed
None
5
2007-04-04
2007-03-19
Anonymous
No

I modified the servlet PhpJavaServlet, HttpSessionFacade and added the necessary classes (following the current structure) for creating a context factory.

The main purpose of these changes are that PHP scripts can access applications that runs whitin J2EE server and can only be discovered through servlet context, for example a Spring managed application.

The changes in PhpJavaServlet are minimal, only added a protected method that constructs the context factory.

Discussion

  • Nobody/Anonymous

    Changes

     
    Attachments
  • Jost Bökemeier

    Jost Bökemeier - 2007-03-20
    • status: open --> pending
     
  • Jost Bökemeier

    Jost Bökemeier - 2007-03-20

    Logged In: YES
    user_id=1637115
    Originator: NO

    Hi,

    the servlet, servletContext, servletRequest are already protected since 4.0.2.

    I will change the visibility of getContext() and add a hook which allows you to wait for it. The patch is attached.

    Here's the new FAQ entry:

    How can is access the Servlet, ServletContext or ServletRequest from a remote PHP script?
    Unless you write your own servlet, you can't. The default implementation of the PhpJavaServlet does not wait for a RemoteServletContextFactory to finish because it cannot reliably determine if a remote script terminated or not.

    If you can provide this information, override the PhpJavaServlet's getContextFactory(). Provide your own RemoteServletContextFactory and create a custom Context in your createContext() method. Then wait for the context by overriding the waitForContext() method.. Ask yourself how to handle a situation where a script asks for a context but doesn't do anything with it, for example: <?php java_context(); ?>. I it okay that the servlet waits 10 minutes until the orphaned context is destroyed?

    Is that okay?

    File Added: php-java-bridge-4.0.2.patch

     
  • Jost Bökemeier

    Jost Bökemeier - 2007-03-20
    • assigned_to: nobody --> jost_boekemeier
     
  • Jost Bökemeier

    Jost Bökemeier - 2007-03-20

    Logged In: YES
    user_id=1637115
    Originator: NO

    File Added: php-java-bridge-4.0.2.patch

     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks