I have 2 war files running on the same web server. There is a login jsp page in the first war. When the user login through the login page, how can I pass the userid to the second war (for example, pass the first web application userid to the session of second web application)?
Any idea? Thanks.
-
How to share value between 2 war files? (4 messages)
- Posted by: George Liao
- Posted on: May 21 2005 00:27 EDT
Threaded Messages (4)
- How to share value between 2 war files? by Dushyanth Inguva on May 23 2005 13:53 EDT
- How to share value between 2 war files? by George Liao on May 24 2005 02:02 EDT
- You are still in the same JVM by S??bastien Tardif on May 26 2005 23:44 EDT
- You are still in the same JVM by George Liao on June 08 2005 21:02 EDT
-
How to share value between 2 war files?[ Go to top ]
- Posted by: Dushyanth Inguva
- Posted on: May 23 2005 13:53 EDT
- in response to George Liao
Which server are you using? This is usually an extension feature.
In websphere, you edit the deployment descriptor and check the "Shared Session Context" checkbox and voila.
In tomcat, you put something like this in the server.xml <Context path="/myapp" docBase="/home/web/myapp'" crossContext="true" debug="0" reloadable="false" trusted="false" />
The crossContext="true" makes sure that the session is shared.
Look at your app server's manual for exact details. -
How to share value between 2 war files?[ Go to top ]
- Posted by: George Liao
- Posted on: May 24 2005 02:02 EDT
- in response to Dushyanth Inguva
Hi Dushyanth,
Thanks a lot for your reply.
I am using WebSphere portal server. Does "Shared Session Context" mean mutiple wars(applications) use the same session, no matter which war creates the session? -
You are still in the same JVM[ Go to top ]
- Posted by: S??bastien Tardif
- Posted on: May 26 2005 23:44 EDT
- in response to George Liao
You can use proprietary extension or instead be more portable by seeing the two web applications as separated and so do what two partners having different web site normally do. I'm sure they are many ways, one of them is sending a normal http request to the second web server will all the information you want to pass!
So the proprietary side, the web applications normally share some base classloader at least the JVM one, so you can have a singleton at this level that's used to pass information around. -
You are still in the same JVM[ Go to top ]
- Posted by: George Liao
- Posted on: June 08 2005 21:02 EDT
- in response to S??bastien Tardif
Thanks Sébastien. We are using the solution just like yours.