You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Günther Wieser <gw...@creative-it.com> on 2005/05/03 16:44:01 UTC

[OT] how to test user role in jsp

hi,

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?

kr,
guenther

--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com



Re: [OT] how to test user role in jsp

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
You can use the logic present/notPresent tags.

<logic:present role="roleA,roleB,roleC">
      .....
</logic:present>

http://struts.apache.org/userGuide/struts-logic.html#present

Niall

----- Original Message ----- 
From: "Günther Wieser" <gw...@creative-it.com>
Sent: Tuesday, May 03, 2005 3:44 PM


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?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] how to test user role in jsp

Posted by Rick Reumann <st...@reumann.net>.
Günther Wieser wrote the following on 5/3/2005 10:44 AM:
> 
> 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?

I like the Struts logic present tag for this:

<logic:present 
role="${UICONSTANTS.ROLE_HELP_LINE},${UICONSTANTS.ROLE_PR_ADM}">
....
</logic:present>

JSTL has one also but, as far as I know, it doesn't check for multiple 
roles like the logic:present one does.

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [OT] how to test user role in jsp

Posted by Günther Wieser <gw...@creative-it.com>.
it's amazing, how could i've missed that functionality of the logic: present
tag??!?!

thanks, guys, sometime the obvious is too near to see it!

kr,
guenther


--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com


-----Original Message-----
From: Joe Germuska [mailto:Joe@Germuska.com] 
Sent: Tuesday, May 03, 2005 6:00 PM
To: Günther Wieser; 'Struts Users Mailing List'
Subject: Re: [OT] how to test user role in jsp

You can use <logic:present> (and
<logic:notPresent>) to conditionally evaluate the user's role:
http://struts.apache.org/userGuide/struts-logic.html#present

Joe


At 4:44 PM +0200 5/3/05, Günther Wieser wrote:
>hi,
>
>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?
>
>kr,
>guenther
>
>--
>Günther Wieser
>
>creative-it
>Guglgasse 6/1/11/1
>A-1110 Wien
>Austria
>http://www.creative-it.com


--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] how to test user role in jsp

Posted by Joe Germuska <Jo...@Germuska.com>.
You can use <logic:present> (and 
<logic:notPresent>) to conditionally evaluate the 
user's role:
http://struts.apache.org/userGuide/struts-logic.html#present

Joe


At 4:44 PM +0200 5/3/05, Günther Wieser wrote:
>hi,
>
>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?
>
>kr,
>guenther
>
>--
>Günther Wieser
>
>creative-it
>Guglgasse 6/1/11/1
>A-1110 Wien
>Austria
>http://www.creative-it.com


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org