tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: sessions and JSP Tag Handlers
Date Mon, 10 Jul 2000 16:02:09 GMT
Joel Regen wrote:

> After further research in the JSP spec (1.1) it appears that perhaps I should be
> using beans and not tags.  Beans seem to be allowed to participate at various scopes
> including session and application.    Tags, it appears, are not intended to have
> scope beyond page.  Anyone want to concur (or not)?
> Joel

It makes sense to think of the tags themselves as having page scope.  However, the code
in a custom tag can easily reference beans in any scope (put there by a <jsp:useBean>
by some other mechanism).  For example:

    MyObject object = pageContext.getAttribute("myKey",

references a session attribute, using the implicit "pageContext" instance variable that
is set by the TagSupport or BodyTagSupport class for you.

Craig McClanahan

View raw message