You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
| 2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
| 2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
| 2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
| 2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
| 2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
| 2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
| 2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
|
4
(3) |
|
5
|
6
(4) |
7
(1) |
8
(1) |
9
|
10
(1) |
11
(5) |
|
12
(4) |
13
(1) |
14
(2) |
15
(2) |
16
(1) |
17
|
18
|
|
19
|
20
(4) |
21
(3) |
22
(6) |
23
(1) |
24
(1) |
25
(4) |
|
26
(1) |
27
(2) |
28
(3) |
29
(1) |
30
|
|
|
|
From: <php...@li...> - 2010-09-20 15:56:14
|
Hi, Is there a way to call the Java Bridge from php so that session_write_close() is NOT called on java shutdown. This was causing problems with my application by saving the session before I had finished using it. I have commented out the offending line in java.inc.php but don't want to have to remember to do this on every upgrade. Regards Ian -- |
|
From: <php...@li...> - 2010-09-16 01:32:12
|
Jost, all -
I have been doing more investigations into why the php-java bridge is
not working as I would expect, but so far I got no joy in why it is
failing... So I thought I would send in a concise version of the jsp
code/file I am trying to set up, and see if you or anyone else can spot
what I am doing wrong.... (this also shows the interplay between jsp
variables and the Javascript/PHP scripts, which is why I am choosing to
use JSP)
What I am discovering, is that as expected the method evalPHP is being
called (twice). The call to the function - outputJavaScript in my PHP
script does indeed return a Javascript statement (via the internal call
to pass_to_php_backend), which is a String variable, and I can in fact
put an echo statement just before the return and see that the expected
Javascript statement is produced. But what is NOT happening is that
this returned string is produced in the output document, at the point of
call to evalPHP. (I have placed calls to alerts to show this is indeed
what is happening, as can be seen in the following code.)
Thoughts? Thanks again in advance for helping me with this... Marc...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<%@ page import="java.io.*" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@page import="javax.script.*" %>
<%@page import="php.java.script.servlet.*" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Example</title>
<%
String url = request.getAttribute("URL").toString();
String file = request.getAttribute("DocPath").toString();
String docRootDir = file.substring(0, file.lastIndexOf("/"));
String serverURL = request.getAttribute("ServerURL").toString();
String contextPath = "/" +
request.getAttribute("ContextPath").toString();
String Dir = request.getAttribute("Dir").toString();
%>
<%
// My PHP script is defined here....
String phpScript = "";
phpScript = "require_once '" + Dir + "/java/Java.inc'; \n";
phpScript += "require_once '" + Dir + "/contrib/php-utilities.php'; \n";
phpScript += "function outputJavaScript() { \n";
phpScript += "$IMConfig = array(); \n";
phpScript += "$IMConfig['images_dir'] = '" + docRootDir + "/images'; \n";
phpScript += "$IMConfig['allowed_image_extensions'] =
array('jpg','gif','png'); \n";
phpScript += "return pass_to_php_backend($IMConfig); \n";
phpScript += "} \n";
phpScript += "outputJavaScript(); \n";
%>
<%!
private static final CompiledScript script;
static {
try {
script =((Compilable)(new
ScriptEngineManager().getEngineByName("php"))).compile(
"<?php echo eval(java_context()->get('script')); ?>");
} catch (ScriptException e) {
throw new RuntimeException("bleh!");
}
}
// private static final String evalPHP(String arg) {
private String evalPHP(String arg, HttpServletRequest request,
HttpServletResponse response) {
CompiledScript instance =
(CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
instance.getEngine().put("script", arg);
OutputStream out = new ByteArrayOutputStream();
Writer writer = new OutputStreamWriter(out);
instance.getEngine().getContext().setWriter(writer);
instance.getEngine().setContext((ScriptContext)new
PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,this.getServletContext(),request,response));
try {
instance.eval();
} catch (ScriptException e) {
throw new RuntimeException("bleh!");
}
try {
writer.close();
} catch (IOException e) {
throw new RuntimeException("bleh!");
}
String result = out.toString();
return result;
}
%>
<script type="text/javascript">
url = <%= "\"" + serverURL + "\"" %> + <%= "\"" + contextPath +
"\"" %>;
lang = "en";
</script>
<!-- <script type="text/javascript" src="../Core.js"></script> -->
<script type="text/javascript" src="Loader.js"></script>
<script type="text/javascript">
config = config ? config : new Backend.Config();
config.fullPage = true;
// pass the configuration to plugin
if (config.FileManager) {
with (config.FileManager)
{
a = "<%= evalPHP(phpScript, request, response) %>";
if (a == "") alert("No Output");
else {
alert("Output = " + a);
<%= evalPHP(phpScript, request, response) %>
}
}
}
};
</script>
</head>
<body>
<!-- Content of body not important, removed -->
</body>
</html>
|
|
From: <php...@li...> - 2010-09-15 03:37:53
|
On 9/14/2010 5:23 PM, php...@li... wrote:
> It should be a method. Thats why clone ls there
I am sorry but I don't follow you... What should be a method? My PHP
script? If that is what you are referring to, then how will that affect
the placement of the output from the script when it is evaluated? And
how do I call it? Perhaps I need a better example to help me grok this?
Keep in mind that what I am trying to accomplish is to executed an
embedded multi-line PHP script inside a Javascript segment, all of which
is inside a .jsp file..... At the moment the PHP script is being
executed, but the output, being done via echo statements in the script
(and called PHP functions) is all being placed at the beginning of the
output document, not at the place where the evalPHP call is made...
Also, are the changes I made to the evalPHP function correct? I presume
that the first argument of evalPHP (String arg....) is the string that
contains the actual script that I want to execute. I have concatenated
all the PHP script lines into a single String variable and this is what
I pass to evalPHP.
Thanks again for all your time and help! Marc...
> On 9/14/10, php...@li...
> <php...@li...> wrote:
>> On 9/14/2010 1:03 PM, php...@li... wrote:
>>
>> Darn, I misspoke, see correction below... Marc
>>> On 9/12/2010 3:48 AM, php...@li...
>>> wrote:
>>>> Hi again,
>>>>
>>>> insert a
>>>>
>>>> instance.getEngine().setContext(new
>>>> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,application,request,response));
>>>>
>>>> before calling instance.eval(). Otherwise JSR223 will use the default
>>>> context, which isn't very usable in a web-context.
>>> Hi Jost - Hmmmm since the method evalPHP, as you sent it to me in your
>>> previous email, is declared private static final, one cannot use the
>>> 'this' parameter. Do you see any problem with removing the static final
>>> from the declaration? That allows this to be called in the context of
>>> the instance of the servlet that is running. But doing so will then
>> OOPS! I meant this to say -
>>> cause the parameters of PhpCompiledHttpScriptContext
>>> - application, request, and response to be undefined since this code is
>>> within the Declaration section of the
>>> servlet. I think the application parameter can be retrieved via a call
>>> to this.getServletContext(), but the only way to get the request and
>>> response parameters will be to pass them in to the evalPHP method. Do
>>> you concur? I am thinking the following -
>>>
>>> private String evalPHP(String arg, HttpServletRequest request,
>>> HttpServletResponse response) {
>>> CompiledScript instance =
>>> (CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
>>> instance.getEngine().put("script", arg);
>>> OutputStream out = new ByteArrayOutputStream();
>>> Writer writer = new OutputStreamWriter(out);
>>> instance.getEngine().getContext().setWriter(writer);
>>> instance.getEngine().setContext((ScriptContext)new
>>>
>>> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,this.getServletContext(),request,response));
>>> try {
>>> instance.eval();
>>>
>>> } catch (ScriptException e) {
>>> throw new RuntimeException("bleh!");
>>> }
>>> try {
>>> writer.close();
>>> } catch (IOException e) {
>>> throw new RuntimeException("bleh!");
>>> }
>>> String result = out.toString();
>>> return result;
>>> }
>>>
>>>
>>> I have gone ahead and tried this, and it almost got me to what I want.
>>> But one problem remains and I don't grok the code enough to be able to
>>> solve on my own, so need a bit more guidance. The PHP script that I want
>>> to embed in the middle of a Javascript section generates a line of
>>> Javascript that I want the servlet to write back out, at the point where
>>> the call to evalPHP is made. But when I execute this jsp servlet, the
>>> generated Javascript from the PHP script is being put out at the very
>>> beginning of the document. (I was also surprised that the return result
>>> from evalPHP is null....)
>>>
>>> Thanks again for all your help! Marc...
>>>
>>>
>>>
>>
|
|
From: <php...@li...> - 2010-09-15 00:23:17
|
It should be a method. Thats why clone ls there
On 9/14/10, php...@li...
<php...@li...> wrote:
> On 9/14/2010 1:03 PM, php...@li... wrote:
>
> Darn, I misspoke, see correction below... Marc
>> On 9/12/2010 3:48 AM, php...@li...
>> wrote:
>>> Hi again,
>>>
>>> insert a
>>>
>>> instance.getEngine().setContext(new
>>> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,application,request,response));
>>>
>>> before calling instance.eval(). Otherwise JSR223 will use the default
>>> context, which isn't very usable in a web-context.
>> Hi Jost - Hmmmm since the method evalPHP, as you sent it to me in your
>> previous email, is declared private static final, one cannot use the
>> 'this' parameter. Do you see any problem with removing the static final
>> from the declaration? That allows this to be called in the context of
>> the instance of the servlet that is running. But doing so will then
> OOPS! I meant this to say -
>> cause the parameters of PhpCompiledHttpScriptContext
>> - application, request, and response to be undefined since this code is
>> within the Declaration section of the
>> servlet. I think the application parameter can be retrieved via a call
>> to this.getServletContext(), but the only way to get the request and
>> response parameters will be to pass them in to the evalPHP method. Do
>> you concur? I am thinking the following -
>>
>> private String evalPHP(String arg, HttpServletRequest request,
>> HttpServletResponse response) {
>> CompiledScript instance =
>> (CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
>> instance.getEngine().put("script", arg);
>> OutputStream out = new ByteArrayOutputStream();
>> Writer writer = new OutputStreamWriter(out);
>> instance.getEngine().getContext().setWriter(writer);
>> instance.getEngine().setContext((ScriptContext)new
>>
>> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,this.getServletContext(),request,response));
>> try {
>> instance.eval();
>>
>> } catch (ScriptException e) {
>> throw new RuntimeException("bleh!");
>> }
>> try {
>> writer.close();
>> } catch (IOException e) {
>> throw new RuntimeException("bleh!");
>> }
>> String result = out.toString();
>> return result;
>> }
>>
>>
>> I have gone ahead and tried this, and it almost got me to what I want.
>> But one problem remains and I don't grok the code enough to be able to
>> solve on my own, so need a bit more guidance. The PHP script that I want
>> to embed in the middle of a Javascript section generates a line of
>> Javascript that I want the servlet to write back out, at the point where
>> the call to evalPHP is made. But when I execute this jsp servlet, the
>> generated Javascript from the PHP script is being put out at the very
>> beginning of the document. (I was also surprised that the return result
>> from evalPHP is null....)
>>
>> Thanks again for all your help! Marc...
>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|
|
From: <php...@li...> - 2010-09-14 20:15:11
|
On 9/14/2010 1:03 PM, php...@li... wrote:
Darn, I misspoke, see correction below... Marc
> On 9/12/2010 3:48 AM, php...@li... wrote:
>> Hi again,
>>
>> insert a
>>
>> instance.getEngine().setContext(new
>> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,application,request,response));
>>
>> before calling instance.eval(). Otherwise JSR223 will use the default
>> context, which isn't very usable in a web-context.
> Hi Jost - Hmmmm since the method evalPHP, as you sent it to me in your
> previous email, is declared private static final, one cannot use the
> 'this' parameter. Do you see any problem with removing the static final
> from the declaration? That allows this to be called in the context of
> the instance of the servlet that is running. But doing so will then
OOPS! I meant this to say -
> cause the parameters of PhpCompiledHttpScriptContext
> - application, request, and response to be undefined since this code is within the Declaration section of the
> servlet. I think the application parameter can be retrieved via a call
> to this.getServletContext(), but the only way to get the request and
> response parameters will be to pass them in to the evalPHP method. Do
> you concur? I am thinking the following -
>
> private String evalPHP(String arg, HttpServletRequest request,
> HttpServletResponse response) {
> CompiledScript instance =
> (CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
> instance.getEngine().put("script", arg);
> OutputStream out = new ByteArrayOutputStream();
> Writer writer = new OutputStreamWriter(out);
> instance.getEngine().getContext().setWriter(writer);
> instance.getEngine().setContext((ScriptContext)new
>
> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,this.getServletContext(),request,response));
> try {
> instance.eval();
>
> } catch (ScriptException e) {
> throw new RuntimeException("bleh!");
> }
> try {
> writer.close();
> } catch (IOException e) {
> throw new RuntimeException("bleh!");
> }
> String result = out.toString();
> return result;
> }
>
>
> I have gone ahead and tried this, and it almost got me to what I want.
> But one problem remains and I don't grok the code enough to be able to
> solve on my own, so need a bit more guidance. The PHP script that I want
> to embed in the middle of a Javascript section generates a line of
> Javascript that I want the servlet to write back out, at the point where
> the call to evalPHP is made. But when I execute this jsp servlet, the
> generated Javascript from the PHP script is being put out at the very
> beginning of the document. (I was also surprised that the return result
> from evalPHP is null....)
>
> Thanks again for all your help! Marc...
>
>
>
|
|
From: <php...@li...> - 2010-09-14 20:03:57
|
On 9/12/2010 3:48 AM, php...@li... wrote:
> Hi again,
>
> insert a
>
> instance.getEngine().setContext(new
> PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,application,request,response));
>
> before calling instance.eval(). Otherwise JSR223 will use the default
> context, which isn't very usable in a web-context.
Hi Jost - Hmmmm since the method evalPHP, as you sent it to me in your
previous email, is declared private static final, one cannot use the
'this' parameter. Do you see any problem with removing the static final
from the declaration? That allows this to be called in the context of
the instance of the servlet that is running. But doing so will then
cause the parameters of evalPHP - application, request, and response to
be undefined since this code is within the Declaration section of the
servlet. I think the application parameter can be retrieved via a call
to this.getServletContext(), but the only way to get the request and
response parameters will be to pass them in to the evalPHP method. Do
you concur? I am thinking the following -
private String evalPHP(String arg, HttpServletRequest request,
HttpServletResponse response) {
CompiledScript instance =
(CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
instance.getEngine().put("script", arg);
OutputStream out = new ByteArrayOutputStream();
Writer writer = new OutputStreamWriter(out);
instance.getEngine().getContext().setWriter(writer);
instance.getEngine().setContext((ScriptContext)new
PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,this.getServletContext(),request,response));
try {
instance.eval();
} catch (ScriptException e) {
throw new RuntimeException("bleh!");
}
try {
writer.close();
} catch (IOException e) {
throw new RuntimeException("bleh!");
}
String result = out.toString();
return result;
}
I have gone ahead and tried this, and it almost got me to what I want.
But one problem remains and I don't grok the code enough to be able to
solve on my own, so need a bit more guidance. The PHP script that I want
to embed in the middle of a Javascript section generates a line of
Javascript that I want the servlet to write back out, at the point where
the call to evalPHP is made. But when I execute this jsp servlet, the
generated Javascript from the PHP script is being put out at the very
beginning of the document. (I was also surprised that the return result
from evalPHP is null....)
Thanks again for all your help! Marc...
|
|
From: <php...@li...> - 2010-09-13 19:29:55
|
Hi
it is in php-servlet.jar
On 9/12/10, php...@li...
<php...@li...> wrote:
> On 9/12/2010 3:23 AM, php...@li... wrote:
>> Hi,
>>
>> please take a look at the jsr223.jsp from the documentation download.
>>
>>
>>> <?php require_once("java/Java.inc");
>> It's a JSP, so you need to use JSP syntax:
>>
>>
>> <%@page import="javax.script.*" %>
>> <%@page import="php.java.script.servlet.PhpCompiledHttpScriptContext" %>
>>
>>
> Thanks Jost for pointing me in the right direction! One immediate
> question comes up however, where do I find
> php.java.script.servlet.PhpCompiledHttpScriptContext? It is not in any
> of the jar files that I picked up....
>
> Marc...
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|
|
From: <php...@li...> - 2010-09-12 17:34:12
|
On 9/12/2010 3:23 AM, php...@li... wrote:
> Hi,
>
> please take a look at the jsr223.jsp from the documentation download.
>
>
>> <?php require_once("java/Java.inc");
> It's a JSP, so you need to use JSP syntax:
>
>
> <%@page import="javax.script.*" %>
> <%@page import="php.java.script.servlet.PhpCompiledHttpScriptContext" %>
>
>
Thanks Jost for pointing me in the right direction! One immediate
question comes up however, where do I find
php.java.script.servlet.PhpCompiledHttpScriptContext? It is not in any
of the jar files that I picked up....
Marc...
|
|
From: <php...@li...> - 2010-09-12 10:48:42
|
Hi again, insert a instance.getEngine().setContext(new PhpCompiledHttpScriptContext(instance.getEngine().getContext(),this,application,request,response)); before calling instance.eval(). Otherwise JSR223 will use the default context, which isn't very usable in a web-context. Regards, Jost Bökemeier |
|
From: <php...@li...> - 2010-09-12 10:41:31
|
Hi Marta, first of all, requestDispatcher.forward() lets you forward POST requests. But I don't think this works with include(). Second: some application servers like Sun Java AS 9 have a very small thread pool size. If you open a loop-back connection to the back end, you risk to lock up the whole application server. AS 9 pool size defaults to 5, which means that 3 concurrent user requests *will* lock up your application server forever, if your servlet opens a HTTP URL connection back to your application server. Apache's pool is larger, it defaults to MaxChilds=150. Send it more than 75 concurrent requests and it will stop responding forever. So file_get_contents(localURL) or a loopback java.net.URLConnection to the back end is not an option. Forget that. If your JSP has been written properly, it separates the business- from the UI logic. So it should be easy to call the business methods from your PHP servlet as well. If not, your only option is to refactor the JSP or to duplicate some of its functionality. A third option (but rather lo-tech) is to ask the browser to deliver the content of your JSP and to deliver it to your PHP servlet using AJAX. Regards, |
|
From: <php...@li...> - 2010-09-12 10:23:49
|
Hi,
please take a look at the jsr223.jsp from the documentation download.
> <?php require_once("java/Java.inc");
It's a JSP, so you need to use JSP syntax:
<%@page import="javax.script.*" %>
<%@page import="php.java.script.servlet.PhpCompiledHttpScriptContext" %>
<%!
private static final CompiledScript script;
static {
try {
script =((Compilable)(new
ScriptEngineManager().getEngineByName("php"))).compile(
"<?php echo eval(java_context()->get('script')); ?>");
} catch (ScriptException e) {
throw new RuntimeException("bleh!");
}
}
private static final String evalPHP(String arg) {
CompiledScript instance =
(CompiledScript)((java.security.cert.CertStoreParameters)script).clone();
instance.getEngine().put("script", arg);
OutputStream out = new ByteArrayOutputStream();
Writer writer = new OutputStreamWriter(out);
instance.getEngine.getContext().setWriter(writer);
instance.eval();
writer.close();
return out.toString();
}
%>
<script type="text/javascript">
var = <%= evalPHP("hello world"); %>
Regards,
Jost Bökemeier
|
|
From: <php...@li...> - 2010-09-11 19:58:08
|
is this your only requirement for using the bridge? have you considered http://de.php.net/manual/en/class.httprequest.php or http://de.php.net/curl instead? On Sat, Sep 11, 2010 at 9:21 PM, <php...@li...> wrote: > > Hi, > > I don't have a use case because what I'm trying to do is a very small thing. Lets see if I can explain a little better. > I'm working with "AHA!" which is an open source adaptive hypermedia architecture. The AHA was developed using Java but I'm working with PHP. This of course is forcing me to work with both languages together. > At the moment what I have to do involves accessing and updating an XML file created by the AHA, which isn't at all a hard thing to do. However, the AHA already has a servlet that does that and one of the Professors I'm working with asked me to try and use that servlet to update the file instead of doing it myself. The servlet receives information from a form (via POST) and updates the XML file accordingly. So basicaly I need to be able to pass information to that specific servlet and I have to do that using PHP. I was trying to do that using file_get_contents() because this method allows me to use a context with which I can send the necessary information. > Does any of this make sense to you? > > Sincerely, > > Marta Fernandes > >> Date: Sat, 11 Sep 2010 13:14:23 +0200 >> To: php...@li... >> From: php...@li... >> Subject: Re: [Php-java-bridge-users] Sending request object to servlet with file_get_contents >> >> Hi, >> >> I don't understand. Do you have a use case? >> >> >> Regards, >> Jost Bökemeier >> >> ------------------------------------------------------------------------------ >> Start uncovering the many advantages of virtual appliances >> and start using them to simplify application deployment and >> accelerate your shift to cloud computing >> http://p.sf.net/sfu/novell-sfdev2dev >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Dominik Dorn http://dominikdorn.com http://twitter.com/domdorn Tausche Deine Lernunterlagen auf http://www.studyguru.eu ! |
|
From: <php...@li...> - 2010-09-11 19:21:15
|
Hi, I don't have a use case because what I'm trying to do is a very small thing. Lets see if I can explain a little better. I'm working with "AHA!" which is an open source adaptive hypermedia architecture. The AHA was developed using Java but I'm working with PHP. This of course is forcing me to work with both languages together. At the moment what I have to do involves accessing and updating an XML file created by the AHA, which isn't at all a hard thing to do. However, the AHA already has a servlet that does that and one of the Professors I'm working with asked me to try and use that servlet to update the file instead of doing it myself. The servlet receives information from a form (via POST) and updates the XML file accordingly. So basicaly I need to be able to pass information to that specific servlet and I have to do that using PHP. I was trying to do that using file_get_contents() because this method allows me to use a context with which I can send the necessary information. Does any of this make sense to you? Sincerely, Marta Fernandes > Date: Sat, 11 Sep 2010 13:14:23 +0200 > To: php...@li... > From: php...@li... > Subject: Re: [Php-java-bridge-users] Sending request object to servlet with file_get_contents > > Hi, > > I don't understand. Do you have a use case? > > > Regards, > Jost Bökemeier > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2010-09-11 16:41:24
|
Hi -
OK, I suspect this may be a bit off the beaten track, but thought I
would ask anywise...
I have set up a Tomcat server with the php-java-bridge servlets and
support, tested and the examples all work fine, so I know the basic
environment works....
Now I have a webapp, and it has a .jsp file that mostly contains
javascript code, along with some jsp variables and of course some html
code. Within one of the javascript sections I want to use a php script,
and I am going to want to do some string substitutions from some of the
jsp variables. That need seems to prevent me from incorporating the php
script in a separate file. So the outline of the file is something like
this -
----------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<%@ page import="java.io.*" %>
<%@ page import="org.apache.commons.lang.*" %>
<head>
<%
// JSP code here, for example -
String url = request.getAttribute("URL").toString();
%>
<script type="text/javascript">
// javascript code here...
if (config.Manager) {
with (config.Manager)
{
<?php require_once("java/Java.inc");
// <?php require_once("http://localhost:8086/mywebapp/java/Java.inc");
$IMConfig = array();
$IMConfig['images_dir'] = '<%= url%>/images';
// more php script here
?>
}
}
</script>
</head>
<body>
// html, javascript, jsp stuff here....
</body>
</html>
-------------
I have been fooling around with this, but so far it does not appear that
I am getting the php script to execute. Can some kind soul help lead
me to a solution? Thanks in advance...
Marc...
|
|
From: <php...@li...> - 2010-09-11 11:28:28
|
Hi, I will look at this problem. Please note that the PHP/Java Bridge currently doesn't use HTTPS to communicate with a JEE back end. I will change the behaviour for 6.2.1. Regards, Jost Bökemeier |
|
From: <php...@li...> - 2010-09-11 11:14:30
|
Hi, I don't understand. Do you have a use case? Regards, Jost Bökemeier |
|
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 |
|
From: <php...@li...> - 2010-09-08 19:48:07
|
And remove source.php from JavaBridge.war or change it to not allow absolute paths. |
|
From: <php...@li...> - 2010-09-07 08:56:25
|
On 06/09/2010 19:38, php...@li... wrote: > Bug: rc doesnt use https at all. Hi, I have the bridge running in a version of Tomcat that only has https available so it doesn't appear to have switched over to standard http on port 8080. If you want me to debug this further please send me instructions. PS Can we all remember to sign our names at the bottom of emails. This list seems to strip out the From: addr (or is that just Thunderbird?) and it may get a little difficult to follow. Regards Ian -- > On 9/6/10, php...@li... > <php...@li...> wrote: >> Hi, >> >> I am posting this in case it can help someone else with the same problem. >> >> I just came across this error using the latest version of the bridge >> (php-java-bridge_6.2.1rc2_documentation.zip): >> >> PHP Notice: Undefined offset: 1 in /JavaBridge/java/Java.inc on line 1072 >> >> It turned out I had forgot to include the 'ssl://' part whilst defining >> the JAVA_HOSTS variable. >> >> SO if your communicating over a https:// link, make sure you add the above. >> >> >> >> Regards >> >> Ian |
|
From: <php...@li...> - 2010-09-06 18:38:55
|
Bug: rc doesnt use https at all. On 9/6/10, php...@li... <php...@li...> wrote: > Hi, > > I am posting this in case it can help someone else with the same problem. > > I just came across this error using the latest version of the bridge > (php-java-bridge_6.2.1rc2_documentation.zip): > > PHP Notice: Undefined offset: 1 in /JavaBridge/java/Java.inc on line 1072 > > It turned out I had forgot to include the 'ssl://' part whilst defining > the JAVA_HOSTS variable. > > SO if your communicating over a https:// link, make sure you add the above. > > > > Regards > > Ian > -- > > ------------------------------------------------------------------------------ > 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 > |
|
From: <php...@li...> - 2010-09-06 16:32:39
|
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 |
|
From: <php...@li...> - 2010-09-06 10:32:16
|
Hi, I am posting this in case it can help someone else with the same problem. I just came across this error using the latest version of the bridge (php-java-bridge_6.2.1rc2_documentation.zip): PHP Notice: Undefined offset: 1 in /JavaBridge/java/Java.inc on line 1072 It turned out I had forgot to include the 'ssl://' part whilst defining the JAVA_HOSTS variable. SO if your communicating over a https:// link, make sure you add the above. Regards Ian -- |
|
From: <php...@li...> - 2010-09-06 02:05:45
|
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 which at the moment isn't happening. Does anyone have any idea of how (if possible) I can achieve this? I have access to the session and servlet request information in the PHP script, I just need to find a way to send it to the servlet. Thanks, Sincerely, Marta Fernandes |
|
From: <php...@li...> - 2010-09-04 12:26:27
|
Fixed in CVS head. You can now allocate a session later on, but only
if running within a JEE environment. If you use Apache, you will get
an error message "response commited", as usual.
<?php require_once("java/Java.inc");
echo java_session(null, false);
echo java_session(null, true);
?>
Running from a JEE server:
=>php...@16....HttpSessionFacade@1635aad
Running from Apache, connected to JEE back end:
=> <b>Fatal error</b>: Uncaught
[[o:Exception]:"java.lang.Exception: Invoke f
ailed: [[o:JavaBridge]]->getSession((o:String)null, (o:short)[o:Short], (o:in
t)[o:Integer]). Cause: java.lang.IllegalStateException: Cannot create a session
after the response has been committed VM: 1.6.0_20@http://java.sun.com/" at
:
Regards,
Jost Bökemeier
|
|
From: <php...@li...> - 2010-09-04 09:44:37
|
>> * Extract the JavaBridge.jar library from JavaBridge.war, for example with the command: java -classpath JavaBridge.war TestInstallation > missing "php-cgi > How can i correct this error? Don't. Use some other procedure to extract the JavaBridge.jar. Or simply download it. Please see http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php for details. Regards, Jost Bökemeier |