tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Brogden <>
Subject Re: does a context get a new session?
Date Tue, 22 Aug 2000 00:56:57 GMT

"Shade, Christopher" wrote:
> I've seen a variety of session problems posted to the list and in the
> archives.  But i'm not sure what's happening in my case.  I have an initial
> JSP that puts a Long object into the session, then the user hits a hyperlink
> to a servlet, which does stuff and forwards to another JSP.  So it's a JSP
> to Servlet to JSP kind of model.  Is it possible that this movement across
> contexts (from the /servlet context to the context i defined in the
> server.xml for my JSPs) is affecting the session?
> Because when I go to the /servlet context, it creates a new session, so the
> Long object isn't there.  But if I just go between JSPs (that are all in the
> same directory) the session retains its state.  And the session retains its
> state when I go from the servlet to a JSP using
> getServletContext().getRequestDispatcher().forward().

I bet that if you examine the cookie being written,it is restricted to
path the JSP pages are on.

WBB -  Chief Scientist, LANWrights, Inc.
Java Programmer Certification information and mock exam

View raw message