Hi All,
Problem Description:
In our project currently, we have a single .war file which contains all the servlets for the whole application. The plan is to separate each tab (we have different Tabs for different screens for e.g. Trading screen, Settlement Screen etc. etc.) into different .war files, i.e. there will be multiple .wars like trading.war, settlement.war etc.
Due to this, the problem arises of maintaining the HTTPSession across multiple .war files. Now, there are various attributes, e.g. user profile, which are stored in the session; and this information needs to be available to all the servlets in all the .wars.
An Example (Simplified) Scenario:
There are two servlets, ServletOne (included in war1.war) and ServletTwo (included in war2.war). ServletOne outputs a form with a button that redirects to ServletTwo.
In ServletOne before redirecting, we set an attribute in the session:
request.getSession(true).setAttribute("test", "test").
In ServletTwo, we try to get the existing session and read the attribute:
request.getSession(false).getAttribute("test"). At runtime, this throws NullPointerException because it is not able to obtain the session.
Following approaches I tried and they did not work:
- Deploy each .war separately
- Package each .war into its own .ear and deploy the separate .ears
- Package all .wars into a single .ear and deploy only this .ear
Possible solutions:
- HTTP Tunneling
- Single Sign-On
Has anybody of you worked on similar lines or anybody else who is associated with you? Some details I would like to know - are these the right solutions for our problem? How easy/difficult are they to implement? Or if you have a better solution for the problem above, it’s most welcome.
Any suggestions you have would be most welcome.
Shivam
-
maintaining the HTTPSession across multiple .war files (4 messages)
- Posted by: shivam Arren
- Posted on: January 28 2005 01:27 EST
Threaded Messages (4)
- maintaining the HTTPSession across multiple .war files by Rob Misek on January 28 2005 12:18 EST
- multiple war by divakar Renganathan on February 14 2005 12:09 EST
- Re: multiple war by Todd Patrick on August 24 2006 05:00 EDT
- maintaining the HTTPSession across multiple .war files by shivam Arren on May 04 2005 04:38 EDT
- multiple war by divakar Renganathan on February 14 2005 12:09 EST
-
maintaining the HTTPSession across multiple .war files[ Go to top ]
- Posted by: Rob Misek
- Posted on: January 28 2005 12:18 EST
- in response to shivam Arren
Hi Shivam,
If you are in a clustered environment you may want to check out the Coherence*Web HTTP session management module included in the Coherence distribution. It which allows you to share session data across multiple web applications (detailed here) easily (i.e. no code change).
Later,
Rob Misek
Tangosol, Inc.
Coherence: It just works -
multiple war[ Go to top ]
- Posted by: divakar Renganathan
- Posted on: February 14 2005 12:09 EST
- in response to Rob Misek
Hi ,
I am also facig similar situation.But I am in the first stage.I am using tiles and for me each tile is comming from different war and I dont know how to access a jsp from different war . -
Re: multiple war[ Go to top ]
- Posted by: Todd Patrick
- Posted on: August 24 2006 17:00 EDT
- in response to divakar Renganathan
Divakar: I don't believe you can since your crossing across containers. -
maintaining the HTTPSession across multiple .war files[ Go to top ]
- Posted by: shivam Arren
- Posted on: May 04 2005 04:38 EDT
- in response to Rob Misek
Hey Rob,
I know its a little late (infact very late) a reply, but I guess its never too late to say Thank You.
Shivam