From: <php...@li...> - 2008-05-28 14:23:07
|
Thanks for the reply. Fortunately this problem solved itself. I was not getting an invocation on Request$PhpNull, but was actually getting an invocation on JavaBridge, which my debugger confirmed. As you have pointed out, I ought to have been seeing an attempt to call a method on Request$PhpNull, because I already had a proper HttpServletContext (or ought to have) and I was attempting to call getServletContext() on that, which is not a defined method. The reason for the bad invocation seems to have been that I failed to upgrade my client includes after upgrading the backend to 5.2.2. Client was 4.3.3. Upgrading the client php include files did the trick. Thanks for the tip about java_inspect(). Somehow I missed that one :) Matt -----Original Message----- From: php...@li... [mailto:php...@li...] On Behalf Of php...@li... Sent: 28 May 2008 15:10 To: php...@li... Subject: Re: [Php-java-bridge-users] trouble getting access to another appcontext running as servlet Hi, you should be able to access the foreign context, provided that the foreign context is accessible. PHP scripts don't behave different than JSP's. In particular the following code should work: <?php require_once("java/Java.inc"); $request = java_context()->getHttpServletRequest(); echo java_inspect($request); $response = java_context()->getHttpServletResponse(); $context = java_context()->getServletContext(); $otherContext = $context->getContext("/JavaBridge"); $dispatcher = $otherContext->getServletContext()->getRequestDispatcher("/my.jsp"); $dispatcher->forward($request, $response); ?> > the parser > php.java.bridge.Parser seems to interpret this as an invocation on the > JavaBridge instance, php.java.bridge.JavaBridge. I think this is a misunderstanding. The Request$PhpNull means that you invoke a Java method with a NULL value, obtained from the previous method call. Either the "/other-context" doesn't exist or it is not accessible. > I'm encouraged by the following var_dump output: You can also use: echo java_inspect($java_value) :) Regards, Jost Boekemeier __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com ------------------------------------------------------------------------ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users This email and any files contained therein is confidential and may contain privileged information. If you are not the named addressee(s) or you have otherwise received this in error, you should not distribute or copy this e-mail or use any of its content for any purpose. Please notify the sender immediately by e-mail if you have received this e-mail in error and delete it from your system |