|
From: <php...@li...> - 2010-12-16 13:42:10
|
Hello,
I want to write a php application that can run with or without JavaBridge.
At first I want just to use Java Context to store global vars that can be
shared for all instances of running application, without need to create them
at every execution of the script (I was using session vars, but it seems not
very smart to me.).
So, the script must run under Apache and, for example, Tomcat. I just copy
the java and WEB-INF folders (from the JavabridgeTemplate), and tried the
following:
require_once ("java/Java.inc");
try {
$ctx = java_context();
}
catch (Exception $e) {
$ctx = NULL;
print $e->getMessage();
}
Using $ctx as a "flag " along the application to use or php session or java
context to store the vars. But the script crash at java_context(). :-(
Is there some "best practice" or pattern to make this? Do you think the idea
is valid?
Thanks for help,
Ely Matos
|