On Wed, 24 Jul 2002, Tim Kettering wrote:

> Apologies if this is a common question - I'm new to the list, and JSTL
> too, but I've searched Google, archives for this listserv and the JSTL
> specs with no luck.

Google and other search engines are also new to JSTL.  :-)  I suspect
it'll be easier to find things in a few months.  But this list is still a
great place to get support.

> Is there a way to retrieve the String returned by
> request.getRemoteUser() using EL in JSTL?
> 
> I'd like to do something like this.
> 
> <c:out value="${requestScope.remoteUser}" /> - but this obviously
> doesn't work.

Right - requestScope refers specifically to request-scoped attributes.

To get request.getRemoteUser(), you need first to get the currently
ServletRequest object and then retrieve the 'remoteUser' property.  To do
this in the JSTL expression language, you can write

 ${pageContext.request.remoteUser}

"JSTL in Action" describes this and other potential applications of the
EL.  Hope that helps!

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


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to