|
From: <php...@li...> - 2010-02-19 09:43:35
|
Here's a corrected example:
<?php
if (!function_exists("virtual")) {
function virtual($path) {
$req = java_context()->getHttpServletRequest();
$res = java_context()->getHttpServletResponse();
$req->getRequestDispatcher($path)->include($req, $res);
}
}
virtual("/sessionSharing.jsp");
echo "<br>... and hello from PHP";
Note that the function virtual() is defined by apache. So we should
name the function "java_virtual()" instead.
?>
On 2/15/10, Jost Boekemeier <jos...@go...> wrote:
> On 2/15/10, php...@li...
> <php...@li...> wrote:
>> I would like to include the output from a JSP or Servlet in my PHP
>> pages. I want something like the following.
>
> Please use the virtual() function. If it is not defined, define it as:
>
> function virtual($res) {
>
> java_context()->getHttpServletRequest()->getRequestDispatcher()->include($res);
> }
>
> Please see
>
> http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html
>
> for details.
>
>
> Regards,
> Jost Bökemeier
>
|