Announcement Announcement Module
No announcement yet.
<authz:authorize ifAllGranted="ROLE_ADMIN"> Tag Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • 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="" %>

    <authz:authorize ifAllGranted="'ROLE_ADMIN">
    include admin links, tools etc...

    When I run this jsp I get the following error:
    java.lang.NoSuchMethodException: org.acegisecurity.userdetails.User.getPrincipal() at java.lang.Class.getMethod( at org.acegisecurity.taglibs.authz.AuthenticationTag. invokeOperation( at org.acegisecurity.taglibs.authz.AuthenticationTag. doStartTag( at org.apache.jsp.WEB_002dINF.jsp.home_jsp._jspx_meth _authz_authentication_0( at org.apache.jsp.WEB_002dINF.jsp.home_jsp._jspServic e( at org.apache.jasper.runtime.HttpJspBase.service(Http 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.

  • #2
    I figured it out .. thanks

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