-
Jun 9th, 2006, 02:23 PM
#1
<authz:authorize ifAllGranted="ROLE_ADMIN"> Tag
I am using Acegi 1.0.0 with Spring 1.2.7 and hit an issue with the 'authz:authorize' tag. Specifically I have a jsp with a conditional block of html that either gets included in the output or not based on the users role so I have something like:
<%@ taglib prefix="authz" uri="http://acegisecurity.org/authz" %>
<authz:authorize ifAllGranted="'ROLE_ADMIN">
include admin links, tools etc...
</authz:authorize>
When I run this jsp I get the following error:
java.lang.NoSuchMethodException: org.acegisecurity.userdetails.User.getPrincipal() at java.lang.Class.getMethod(Class.java:1581) at org.acegisecurity.taglibs.authz.AuthenticationTag. invokeOperation(AuthenticationTag.java:112) at org.acegisecurity.taglibs.authz.AuthenticationTag. doStartTag(AuthenticationTag.java:83) at org.apache.jsp.WEB_002dINF.jsp.home_jsp._jspx_meth _authz_authentication_0(home_jsp.java:2021) at org.apache.jsp.WEB_002dINF.jsp.home_jsp._jspServic e(home_jsp.java:434) at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet .java:802) at ....
What do I need to do to sort this out??? I checked the api and sure enought the getPrincipal() method is not there.
Thanks in advance for your help.
-Derrick
-
Jun 9th, 2006, 02:56 PM
#2
I figured it out .. thanks
I figured it out ... need to use the 'username' and not 'principal' property on the User object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules