Announcement Announcement Module
Collapse
No announcement yet.
<authz:authorize ifAllGranted="ROLE_ADMIN"> Tag Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <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

  • #2
    I figured it out .. thanks

    I figured it out ... need to use the 'username' and not 'principal' property on the User object.

    Comment

    Working...
    X