struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McDonnell, Colm (MLIM)" <>
Subject RE: [OT] how to test user role in jsp
Date Tue, 03 May 2005 15:38:48 GMT
The Struts logic tags will do this

<logic:present role="YOUR_ROLE_NAME_HERE">
    <a href="#foo">foo</a>

If the current user has the named role (as determined by calling request.isUserInRole(...))
then the conditional markup will be rendered.

I don't know whether you can do this using JSTL, I don't think this would work:

<c:if test=${request.isUserInRole('YOUR_ROLE_NAME_HERE')}>

But perhaps you could access the roles array within the principal (within the request)?

-----Original Message-----
From: Günther Wieser [] 
Sent: 03 May 2005 15:44
To: 'Struts Users Mailing List'
Subject: [OT] how to test user role in jsp


sorry for posting something that's very likely not really related to struts
(but maybe it is, who knows), but coudn't find anything on the net.

i would like to display a link depending if a user is in a certain role. is
there a test i could use in <c:if test=${...}> or anything else i could use
as a tag to do this? do i need to implement this on my own?


Günther Wieser

Guglgasse 6/1/11/1
A-1110 Wien

If you are not an intended recipient of this e-mail, please notify the sender, delete it and
do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important
additional terms relating to this e-mail.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message