I created two application App1 and App2, under App1 I created a servlet servlet1 created a session and put the value "renewal" like below
String renewal="Y";
HttpSession session = request.getSession(true);
session.setAttribute("renewal",renewal);
and created servelt named servlet2 in App2 application and tried to read the
renewal session value like below
HttpSession session = request.getSession(true);
System.err.println("Renewal session value
"+(String)session.getAttribute("renewal"));
I got null value.
At the same time when i put both servlets in same application I got the value
back.
Two application are running under same OC4J
Thanks
kiru
-
How to read session values across application (5 messages)
- Posted by: kiru kumar
- Posted on: August 26 2004 19:05 EDT
Threaded Messages (5)
- How to read session values across application by Rob Misek on August 26 2004 20:41 EDT
- Sharing value across sessions across applications by Aditya Pandit on August 27 2004 15:02 EDT
- Sharing value across sessions across applications by Padmanabh Kulkarni on August 27 2004 03:27 EDT
- Sharing value across sessions across applications by Aditya Pandit on August 27 2004 15:02 EDT
- Using the database by Thierry Danard on August 26 2004 23:03 EDT
- correction by Thierry Danard on August 26 2004 23:03 EDT
-
How to read session values across application[ Go to top ]
- Posted by: Rob Misek
- Posted on: August 26 2004 20:41 EDT
- in response to kiru kumar
Hi Kiru,
By default http sessions are not shared across applications. With Coherence*Web you can easily shares session across applications as well as in a cluster.
Later,
Rob Misek
Tangosol, Inc.
Coherence: It just works. -
Sharing value across sessions across applications[ Go to top ]
- Posted by: Aditya Pandit
- Posted on: August 27 2004 15:02 EDT
- in response to Rob Misek
Session objects are context specific. Meaning they are not shared across multiple application contexts.In some web containers(like tomcat) they allow something like "crosscontext" which allows the context to be shared across applications. you might wanna look into your webcontainers documentation if it allows something like that.
<Context path="/examples" docBase="webapps/examples" crossContext="false" debug="0" reloadable="true" > </Context>
~Adi -
Sharing value across sessions across applications[ Go to top ]
- Posted by: Padmanabh Kulkarni
- Posted on: August 27 2004 15:27 EDT
- in response to Aditya Pandit
Probably u might want to get the context of App1 and then get the session for that app and look into it. But is it possible ? -
Using the database[ Go to top ]
- Posted by: Thierry Danard
- Posted on: August 26 2004 23:03 EDT
- in response to kiru kumar
Have App1 insert a record in a table that will be read by App1. -
correction[ Go to top ]
- Posted by: Thierry Danard
- Posted on: August 26 2004 23:03 EDT
- in response to Thierry Danard
I meant "that will be read by App2"