tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: Is a way to access/retrieve an attribute in the session scope using JSTL
Date Tue, 06 Aug 2002 22:29:13 GMT
Hi Vernon,

> I have read the chapter 3 of Shawn's book last night. I thought I
> could find out how to access an attribute in the session scope after
> the page scope mentioned in the chapter. The chapter, however, doesn'
> mention the topic.

Sure it does - see section 3.2 (specifically p. 49 and table 3.2).

> Is an equivalent JSTL tag for the script
> 
> <%request.getSession().getAttribute(WebKeys.UserID)%>

You'd use 'sessionScope'.  I'm not clear what "WebKeys.UserID" is, but if
you had

 request.getSession().getAttribute(foo)

this would be equivalent to the JSTL EL expression

 ${sessionScope[foo]}

If it were

 request.getSession().getAttribute(foo)

then you could write either of the following:

 ${sessionScope.foo}

or

 ${sessionScope["foo"]}

Hope that helps; please let us know if you've got any further questions.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


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


Mime
View raw message