struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@gmail.com>
Subject Re: Creating menu bar based on session information
Date Fri, 15 Apr 2011 13:13: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.

sounds good.

I actually have now that signature in an AbstractAction from which all
the other extend:

public boolean hasPrivileg(String role) { ... }

In my JSP:

<s:if test="hasPrivilege(\"user\")">Login</s:if>

I did not understand why you putted #user.roles in your example.

However, my debugger is never going int the hasPrivileg method. What
am I missing?

Cheers
Christian

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


Mime
View raw message