|
From: <php...@li...> - 2010-05-31 13:24:52
|
Hi,
> you are calling procedures from the servlet package outside of a servlet
> environment. I am surprised that this works at all.
I only attempted this so I could isolate the development of the Java to PHP side from my servlet.
> Outside of a servlet env use:
>
> public static void main(String s[]) throws Exception {
> ScriptEngine e = new ScriptEngineManager().getEngineByName("php-invocable");
> e.eval("<?php class X { public function f() {return 'hello';} }
> java_context()->call(java_closure(new X())); ?>");
> System.out.println(((Invocable)e).invokeMethod(e.get("php.java.bridge.PhpProcedure"),
> "f", new Object[]{}));
> ((Closeable)e).close();
Why could I not reference an actual script file?
I tested the example you gave and it worked but the application hung. Is that normal?
> Btw to avoid confusion: The engine key PhpProcedure is the environment that
> has been passed to the java continuation via java_context()->call(ENV) --
> continuations are modeled as procedures, that's why it's called
> "PhpProcedure"
I don't follow: is there some other key I should have used? I'm missing the point here.
I'm now trying to get PHPJavaBridge deployed on my Jetty test server. I've got the following setup:
Jetty
lib
ext
JavaBridge.jar
php-script.jar
php-servlet.jar
script-api.jar
webapps
JavaBridge.war
java
Java.inc
So when I try to browse http://localhost:8080/JavaBridge I get:
Cannot access /java within the current web directory.
I have tried putting the java directory under Jetty, under lib and under ext but I get the same error. Any ideas?
Thanks again,
Bernard.
_________________________________________________________________
View photos of singles in your area! Looking for a hot date?
http://clk.atdmt.com/NMN/go/150855801/direct/01/
|