aspose file tools*
The moose likes Servlets and the fly likes Vanishing Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Vanishing Sessions" Watch "Vanishing Sessions" New topic
Author

Vanishing Sessions

Eric Stephens
Greenhorn

Joined: Jun 14, 2001
Posts: 11
We have two jsps (j1,j2) and two servlets (s1,s2) and we are trying to share some session data (search criteria) between the all four elements. Here is the flow:
1. get j1, enter data, submit to s1
2. s1 performs a database retrieval , sets the criteria in session, sets the retrieval result in session, and then forwards to j2.
3. j2 displays the data and allows the user to submit, for one particular item on the screen, a request to s2. Note that j2 is able to display the session data from s1's setAttribute(...).
4. s2 performs database work on behalf of the j2 request and then forwards to either j1 or s1.
Regardless of forwarding to j1 or s1, we loose the session data. This seems like a simple interaction where a session can store useful information, so we're very puzzled why the session seems to disappear.


Eric A. Stephens<BR>Sun Certified Programmer for the Java? 2 Platform<BR>ericastephens@mycingular.com
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Are all of these jsp and servlets part of the same web application? Both servlets declared in the same web.xml?
Also - when you store retrieval results in the session, are you storing Strings or something like a ResultSet?
Bill

Java Resources at www.wbrogden.com
Eric Stephens
Greenhorn

Joined: Jun 14, 2001
Posts: 11
They are being tested under VAJ 3.02's WebSphere test environment, so I would have to say yes to the first question.
The object being stored in the session is a java.util.Properties object.
Originally posted by William Brogden:
Are all of these jsp and servlets part of the same web application? Both servlets declared in the same web.xml?
Also - when you store retrieval results in the session, are you storing Strings or something like a ResultSet?
Bill

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
So the problem seems to be that the session associated with s1 and j2 does not get to s2. Exactly how do these servlets get addressed?
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Vanishing Sessions
 
Similar Threads
Help.....Thread
Multiple entries to JSP
Runtime intermediate storage - Design Problem
Stateful Session vs Stateless Session
Best way