tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: Retrieve a session attribute
Date Thu, 14 Apr 2005 18:55:28 GMT
On 4/14/05, Vernon <vwu725@yahoo.com> wrote:
> 
> --- Martin Cooper <mfncooper@gmail.com> wrote:
> 
> >
> > In a servlet, a session will be created on a call to
> > getSession() or
> > getSession(true) if one did not already exist. In a
> > JSP, if a session
> > does not exist and the page has session="true", one
> > will be created.
> >
> > --
> 
> I thought a JSP would share the same session within
> the servlet if a session already exists in the
> container. JSP is eventually translated into servlet
> code, doesn't it?

Yes, they share the session. It really wouldn't make much sense
otherwise. ;-) But by specifying 'session="false"' you have asked the
JSP container to deny that page access to the session, even if it
exists.

--
Martin Cooper


> I insert the log message code in the servlet before
> getting to the JSP and find that a session already
> exists at the point. If a session in JSP is unrelated
> with a session in servlet, how these two share session
> attributes?
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message