From: <php...@li...> - 2007-01-05 16:46:59
|
Hi James, > What if I call > http://localhost/testJava.php > > and testJava.php file includes the (pure Java) > PHP/Java bridge and makes a > call on a new Java object. the bridge uses a named-pipe connection to call the JVM. The bridge calls the J2EE/Servlet back end only if a persistent connection doesn't exist or when the script contains java_session() call and the PHP instance doesn't have a session object. > course.) If the JavaBridge > servlet is not running then the Java call(s) will > fail. Well, yes. The pure PHP implementation currently doesn't use persistent connections. But that's an implementation detail. > So in this instance, Tomcat *does* see the request Yes, you're right. But the request/response objects created for the initial PUT request will vanish when the request is done. Furthermore they don't contain any usable values for you. If you really want to use PHP within Apache, you must fake a request/response pair, for example by using a Request/ResponseWrapper (see the J2EE servlet documentation). > The issue though, is some of the Java classes I'm > using want to write out > (D)HTML using objects that exist in the Servlet > context - obviously that > won't work if being called from Apache -> PHP -> > Tomcat Java/Bridge. It shouldn't be too difficult to write a ServletContextWrapper either. > I suppose my other option would be to run the PHP > file from Tomcat instead > of Apache... that may not be so bad, but it feels > like then I'm just a step > away from using pure Servlets + JSP and I could drop > PHP entirely. :) I don't think so. PHP, as an interpreted language, has many advantages over JSP. PHP doesn't need a development tool (a compiler) installed at run-time, it emmits clear error messages instead of obscure messages from the compiler ("compilation error in file bst_foo$__jsp.java ..."). Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |