title: Spring security Taglib
body: <p>i want use spring security taglibs in my jsf project,so I've made ​​the following changes to the project,but I get this Exception:</p>
  
  <blockquote>
    <p>Error occurred during deployment: Exception while loading the app :
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: java.lang.RuntimeException:
    com.sun.faces.config.ConfigurationException:
    java.lang.ClassNotFoundException:
    org.springframework.faces.security.FaceletsAuthorizeTagHandler. Please
    see server.log for more details.</p>
  </blockquote>
  
  <p>What am I doing wrong here?
  i use :</p>
  
  <blockquote>
    <p>netbeans 7.1.2 --spring mvc 3.0.6-- spring security 3.1.1--glassfish 3.1.2 and jsf 2.1</p>
  </blockquote>
  
  <p><strong>springsecurity.taglib.xml:</strong></p>
  
  <pre><code>   &lt;!DOCTYPE facelet-taglib PUBLIC
    "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
    "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"&gt;
  &lt;facelet-taglib&gt;
      &lt;namespace&gt;http://www.springframework.org/security/tags&lt;/namespace&gt;
      &lt;tag&gt;
          &lt;tag-name&gt;authorize&lt;/tag-name&gt;
          &lt;handler-class&gt;org.springframework.faces.security.FaceletsAuthorizeTagHandler&lt;/handler-class&gt;
      &lt;/tag&gt;
      &lt;function&gt;
          &lt;function-name&gt;areAllGranted&lt;/function-name&gt;
          &lt;function-class&gt;org.springframework.faces.security.FaceletsAuthorizeTagUtils&lt;/function-class&gt;
          &lt;function-signature&gt;boolean areAllGranted(java.lang.String)&lt;/function-signature&gt;
      &lt;/function&gt;
      &lt;function&gt;
          &lt;function-name&gt;areAnyGranted&lt;/function-name&gt;
          &lt;function-class&gt;org.springframework.faces.security.FaceletsAuthorizeTagUtils&lt;/function-class&gt;
          &lt;function-signature&gt;boolean areAnyGranted(java.lang.String)&lt;/function-signature&gt;
      &lt;/function&gt;
      &lt;function&gt;
          &lt;function-name&gt;areNotGranted&lt;/function-name&gt;
          &lt;function-class&gt;org.springframework.faces.security.FaceletsAuthorizeTagUtils&lt;/function-class&gt;
          &lt;function-signature&gt;boolean areNotGranted(java.lang.String)&lt;/function-signature&gt;
      &lt;/function&gt;
      &lt;function&gt;
          &lt;function-name&gt;isAllowed&lt;/function-name&gt;
          &lt;function-class&gt;org.springframework.faces.security.FaceletsAuthorizeTagUtils&lt;/function-class&gt;
          &lt;function-signature&gt;boolean isAllowed(java.lang.String, java.lang.String)&lt;/function-signature&gt;
      &lt;/function&gt;
  &lt;/facelet-taglib&gt;
  </code></pre>
  
  <p><strong>web.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  
  
  &lt;!--  /========================jsf config=============================/--&gt;
  
    &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
          &lt;param-value&gt;Development&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.THEME&lt;/param-name&gt;
          &lt;param-value&gt;#{sessionManager.theme}&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
       &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;/index.xhtml&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
    &lt;!--  /========================spring config=============================/--&gt;  
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /WEB-INF/applicationContext.xml
              /WEB-INF/spring-security.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/springsecurity.taglib.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;listener&gt;
      &lt;listener-class&gt;
        org.springframework.security.web.session.HttpSessionEventPublisher
      &lt;/listener-class&gt;
    &lt;/listener&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;
              org.springframework.web.filter.DelegatingFilterProxy
          &lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>mypage.xhtml:</strong></p>
  
  <pre><code>xmlns:sec="http://www.springframework.org/security/tags"
  .
  .
  .
  &lt;sec:authorize access="ROLE_SUPERADMIN"&gt;
        &lt;h:outputText value="test" /&gt;                          
  &lt;/sec:authorize&gt;
  </code></pre>
  
  <p><strong>mylib :</strong></p>
  
  <pre><code>    org.springframework.cglib-2.2   3.0.6.RELEASE
      org.springframework.aop 3.0.6.RELEASE
      org.springframework.asm 3.0.6.RELEASE
      org.springframework.aspects 3.0.6.RELEASE
      org.springframework.beans   3.0.6.RELEASE
      org.springframework.context 3.0.6.RELEASE
      org.springframework.context.support 3.0.6.RELEASE
      org.springframework.core    3.0.6.RELEASE
      org.springframework.expression  3.0.6.RELEASE
      org.springframework.instrument 3.0.6.RELEASE
      org.springframework.expression  3.0.6.RELEASE
      org.springframework.jdbc    3.0.6.RELEASE
      org.springframework.jms 3.0.6.RELEASE
      org.springframework.orm 3.0.6.RELEASE
      org.springframework.oxm 3.0.6.RELEASE
      org.springframework.test    3.0.6.RELEASE
      org.springframework.tx  3.0.6.RELEASE
      org.springframework.web 3.0.6.RELEASE
      org.springframework.webmvc-portlet  3.0.6.RELEASE
      org.springframework.webmvc  3.0.6.RELEASE
      org.springframework.struts  3.0.6.RELEASE
      commons-logging-1.1.1
      jsf 2.1-jsf-api
      jsf 2.1 -jsf-impl
      jstl 1.1-standard
      jstl 1.1-jstl
      spring-security-ldap-3.1.1.RELEASE.jar
      spring-security-config-3.1.1.RELEASE.jar
      spring-security-core-3.1.1.RELEASE.jar
      spring-security-taglibs-3.1.1.RELEASE.jar
      spring-security-web-3.1.1.RELEASE.jar
  </code></pre>