struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Demetz <mar...@demetz.eu>
Subject Re: Creating menu bar based on session information
Date Fri, 15 Apr 2011 12:06:22 GMT
you could do something like this:
<s:if test="hasPrivilege(#user.roles)">...</s:if> where (bool) 
hasPrivilege(List<Roles>,...) is a function in your action.

Markus

Am 15.04.2011 13:57, schrieb Christian Grobmeier:
> Hi all,
>
> this is probably a trivial question, but I am unsure how to solve it best.
>
> I have an object User user. It has the properties name, password and
> List<Roles>  roles.
>
> Now I would like to create a navigation bar in my struts 2.2.1 jsp pages.
>
> I wanted to avoid huge chunks of logic in my code. Therefore java code
> in my templates should be avoided.
>
> I have thought if the if/else struts tag would help me. But can I
> access a list and look if a specific role is there?
>
> How do others do that?
>
> Thanks in advance,
> Christian
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message