Announcement Announcement Module
Collapse
No announcement yet.
Security Tags not working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Security Tags not working

    Hello everybody,

    So I have a simple jsp Project with spring, hibernate, jsf, richfaces, facelets and jsps. I have a simple welcome page just to test the spring security tags and everything works fine.

    I wanted to switch to xhtml pages but when I do that the spring security tags aren't working anymore and I have no idea why. Any help is greatly appreciated!

    Here are my settings for the xhtml project:

    welcome.xhtml

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:security="http://www.springframework.org/security/tags">


    <security:authorize access="hasRole('ROLE_ADMIN')">
    TEST
    </security:authorize>
    HELLO
    <security:accesscontrollist hasPermission="READ" domainObject="#{category}">
    <a href="category.do?id=#{category.name}">#{category. name}</a>
    </security:accesscontrollist>
    </html>



    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>SpringTest</display-name>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>facelets.VIEW_MAPPINGS</param-name>
    <param-value>*.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>facelets.SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>facelets.REFRESH_PERIOD</param-name>
    <param-value>0</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.PARTIAL_STATE_SAVING_DISPATCH_EVE RY_TIME</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>org.richfaces.LoadScriptStrategy</param-name>
    <param-value>none</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    <init-param>
    <param-name>forceparser</param-name>
    <param-value>false</param-value>
    </init-param>
    <init-param>
    <param-name>enable-cache</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>maxRequestSize</param-name>
    <param-value>80000000</param-value>
    </init-param>
    <init-param>
    <param-name>createTempFiles</param-name>
    <param-value>true</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    </filter-mapping>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    <listener>
    <listener-class>org.springframework.security.web.session.Htt pSessionEventPublisher</listener-class>
    </listener>
    <listener>
    <listener-class>org.springframework.web.context.request.Requ estContextListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>240</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>/index.html</welcome-file>
    </welcome-file-list>
    </web-app>

    A list of the libraries can be found in the attachment.

    Thanks a lot
Working...
X