tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Regen <j...@Globeset.com>
Subject Re: sessions and JSP Tag Handlers
Date Mon, 10 Jul 2000 20:08:45 GMT


"Craig R. McClanahan" wrote:

> Joel Regen wrote:
>
> >
> > What if, in a tag handler, I had code like:
> >
> >     pageContext.getSession().setAttribute( "foo", bar, PageContext.SESSION_SCOPE);
> >
> > and in another tag handler, referenced on another page I had:
> >
> >     pageContext.getSession().getAttribute( "foo", PageContext.SESSION_SCOPE);
> >
> > Would that be sufficient to create and access an object with session scope entirely
within
> > the tag handler semantics?
> >
>
> Actually, you should leave the getSession() thing out of these calls:
>
>     pageContext.setAttribute("foo", bar, PageContext.SESSION_SCOPE);
>     bar = pageContext.getAttribute("foo", PageContext.SESSION_SCOPE);
>
> This is preferable to using the session object directly, because it assures synchronization
> between the page context (for your tags) and the actual session attributes.
>

this is not working between pages. any ideas on why?




Mime
View raw message