|
From: Jost B. <jos...@ya...> - 2005-10-05 16:11:51
|
Hi,
> Is it possible to make objects created in Java to
> persist between HTTP Requests?
You can use:
session_start();
if(!$_SESSION['v'])
$_SESSION['v']=new java(...);
...
The above is syntactic shugar for:
if(!java_session("PHPSESSION")->get('v'))
java_session("PHPSESSION")->put('v', new java(...));
If you want to share your session vars with .jsp,
please use java_session() instead.
Please see http://php-java-bridge.sourceforge.net/ and
the ISession documentation for details.
> I'd like to create an object once, and than store it
> in shared memory, perhaps using apc_store() and
> apc_fetch().
If the object implements java.io.Serializable that
would be another option, yes. But instead of storing
the information on the client side I would obtain a
session store from the server and rely on the backend
to do session replication.
Regards,
Jost Boekemeier
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
|