From: <php...@li...> - 2010-09-10 02:17:21
|
Hi, I did some research on requestDispatcher.include() and java_virtual() and I see why you recommended their use. However, I'm using the file_get_contents() method in order to post some data to the servlet (using the stream_context_create() method). I don't suppose I can do that with either requestDispatcher.include() or java_virtual(). Or can I? Sincerely, Marta Fernandes > Date: Mon, 6 Sep 2010 18:32:33 +0200 > To: php...@li... > From: php...@li... > Subject: Re: [Php-java-bridge-users] Sending request object to servlet with file_get_contents > > Hi, > > > I need to access a servlet (not created by me) from a PHP script using > > file_get_contents, but I need to maintain the same session > > Don't. Please use requestDispatcher.include() instead. > > You cannot re-connect to the current HTTP server. If you do, you might > run into a deadlock. > > Imagine a HTTP server with a pool size of 1. If you invoke a script > t1.php and open a URLConnection back to http://localhost/t2.php, you > HTTP server will block until t1 terminates, which will never happen > because it waits for the HTTP server to deliver the content of t2. > > Please either use the java_virtual() method or (if running in apache > or iis) the virtual() method, which bypass the HTTP servers > thread-/process pool. > > This will solve your session problem, too. :) > > > Regards, > Jost Bökemeier > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |