• Subject: Session Persistence in WebSphere
  • From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 27 Dec 2000 18:51:42 -0600
  • Importance: Normal

I've run into an interesting problem that perhaps someone can help me with.

I've create two servlets and two JavaServer Pages.  Each does exactly the
same thing, with one exception.  What they all do is:

1. Get the session with "request.getSession(false)"
2. Print out some session information
3. Add 1 to a counter stored in the session and display it
4. Provide HREF links to the other three components

The only difference is that Servlet 1 does a "getSession(true)".

For the most part, the components work how I expected them to.  I must start
by bringing up the first servlet, or else I get null from the getSession

Servlet1->Servlet2 getSession returns the same session.
Servlet1->JSP1 getSession returns the same session.
Servlet1->JSP2 getSession returns the same session.

Servlet2->Servlet1 getSession returns the same session.
Servlet2->JSP1 getSession returns the same session.
Servlet2->JSP2 getSession returns the same session.

JSP1->Servlet1 getSession RETURNS A NEW SESSION.
JSP1->Servlet2 getSession RETURNS NULL.
JSP1->JSP2 getSession returns the same session.

JSP2->Servlet1 getSession RETURNS A NEW SESSION.
JSP2->Servlet2 getSession RETURNS NULL.
JSP2->JSP1 getSession returns the same session.

Even more interesting, even though going from a JSP to servlet 2 causes
getSession to return null, going from servlet 2 to another JSP GETS THE OLD

Any clues?  I'm running WAS3.0.2 on V4R4, and I might be behind in PTFs.
But even if you don't know why this is happening, could someone tell me
whether they agree with me that ALL instances above should return the same
session.  It's not apparent to me why a JSP would invalidate the session
(but not when going to another JSP!).

Also, all of my code in the servlets is in the doGet method, if that makes
any difference.


Also, feel free to point me at a good URL for searching for known WebSphere
problems.  I'm going to go hunting myself, but if you know of one, please
let me know.

| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.