If I have an EAR containing multiple WARs and set a session variable in one of the WARs, is that var accessible to the other WARs in the EAR? If so, do I have to do anything special to get the value? If not, are cookies the only way to go to acheive this?
Thanks,
Mark
Discussions
Web tier: servlets, JSP, Web frameworks: Sharing session variables between web applications
-
Sharing session variables between web applications (7 messages)
- Posted by: M J
- Posted on: July 26 2004 15:34 EDT
Threaded Messages (7)
- Sharing session variables between web applications by Rene Zanner on July 28 2004 06:33 EDT
- Sharing objects between web applications by M J on July 29 2004 14:00 EDT
- I face the same problem. by Zhidao Xu on August 06 2004 04:29 EDT
- Sharing session variables between web applications by Matt DeC on September 30 2004 12:41 EDT
-
Sharing session variables between web applications by analog boy on December 22 2004 03:43 EST
-
Sharing session variables between web applications by Carlos Henrique Duarte on February 04 2005 06:43 EST
- Re: Sharing session variables between web applications by Imran Ali on June 29 2009 06:08 EDT
-
Sharing session variables between web applications by Carlos Henrique Duarte on February 04 2005 06:43 EST
-
Sharing session variables between web applications by analog boy on December 22 2004 03:43 EST
-
Sharing session variables between web applications[ Go to top ]
- Posted by: Rene Zanner
- Posted on: July 28 2004 06:33 EDT
- in response to M J
By design the sessions between different web applications cannot be shared. The JSP specification prohibits that.
If you want to share information between web applications, you have to find a different way. Sorry if that does not help you very much, but since I did not have the necessity to share state between different web applications, I cannot help you with an out-of-the-box solution for that problem.
Maybe it's possible to use an instance on enterprise application level, e.g. a stateful session bean or even a database table - but maybe that's too much overhead.
Why do you need to share state variables between those applications?
Cheers,
René -
Sharing objects between web applications[ Go to top ]
- Posted by: M J
- Posted on: July 29 2004 14:00 EDT
- in response to Rene Zanner
Ok, maybe session variables is the wrong term. I have a user object that gets created in one WAR that I need to use in another WAR in the same EAR.
What is the best way (that isn't overly complex) to do this? -
I face the same problem.[ Go to top ]
- Posted by: Zhidao Xu
- Posted on: August 06 2004 04:29 EDT
- in response to Rene Zanner
I have one EAR(main application, called MA) and one WAR(supporting application, just JIRA).
I want to integrate JIRA with MA, since I want to use JIRA as part of my application MA. User starts from MA and when he want some extra information, he will click the link in MA and then link to JIRA.
But MA has a session expiry checking.
When user works with JIRA, MA should not treat he as idle. If user finally were kidded off by JIRA, the MA will also expire the session of user.
Is there anyone could give me some light about this?
Thanks -
Sharing session variables between web applications[ Go to top ]
- Posted by: Matt DeC
- Posted on: September 30 2004 12:41 EDT
- in response to Rene Zanner
If you are using WebSphere / WSAD you can do it. IBM's non-j2ee compliant way of doing this involves a file called sessionshare.xml. In this file you list the enterprise application names where you want to enable sharing. Google sessionshare.xml for more info. -
Sharing session variables between web applications[ Go to top ]
- Posted by: analog boy
- Posted on: December 22 2004 15:43 EST
- in response to Matt DeC
Because the default session implementation of session handling uses cookies you cannot access session information across contexts, browser security stops the server from sharing the cookie info. -
Sharing session variables between web applications[ Go to top ]
- Posted by: Carlos Henrique Duarte
- Posted on: February 04 2005 06:43 EST
- in response to analog boy
I got the following documentation on Java Forum. I hope this help.
http://forum.java.sun.com/thread.jspa?forumID=33&threadID=259394
Best regards -
Re: Sharing session variables between web applications[ Go to top ]
- Posted by: Imran Ali
- Posted on: June 29 2009 06:08 EDT
- in response to Carlos Henrique Duarte
hmmm we can do this according to J2EE spec but has been implemented in several application servers like WebLogic, WebSphere or JBoss for example. http://tedorgwp.free.fr/?p=163