Java jsf上的过滤器链&x2B;美丽的面孔+;春季安全
在jsf中,我通常可以在自动用于重定向的函数中返回字符串 例如: 爪哇:Java jsf上的过滤器链&x2B;美丽的面孔+;春季安全,java,spring,jsf,redirect,jsf-2,Java,Spring,Jsf,Redirect,Jsf 2,在jsf中,我通常可以在自动用于重定向的函数中返回字符串 例如: 爪哇: @ManagedBean @SessionScoped @Component public class TestController implements Serializable { public String testButton(){ return "index"; } } xHTML: <h:form> <p:commandButton v
@ManagedBean
@SessionScoped
@Component
public class TestController implements Serializable {
public String testButton(){
return "index";
}
}
xHTML:
<h:form>
<p:commandButton value="return to index" actionListener="#{testController.testButton}" ajax="false" />
</h:form>
这让我想到,我的过滤链设置不正确
我的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"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<!-- PrimeFaces -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<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>*.xhtml</url-pattern>
</servlet-mapping>
<!-- "normal" Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/applicationContext.xml
classpath:spring/security.xml
</param-value>
</context-param>
<!-- Spring security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/springsecurity.taglib.xml</param-value>
</context-param>
<!-- filterchain -->
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Error Page 404 -->
<error-page>
<error-code>404</error-code>
<location>/error.xhtml?errorID=404</location>
</error-page>
</web-app>
facelets.DEVELOPMENT
真的
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.xhtml
org.springframework.web.context.ContextLoaderListener
上下文配置位置
类路径:spring/applicationContext.xml
类路径:spring/security.xml
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
javax.faces.FACELETS\u库
/WEB-INF/springsecurity.taglib.xml
springSecurityFilterChain
/*
404
/错误。xhtml?错误ID=404
那么现在我的具体问题是:
您好,
Christopher除此之外,托管bean上还有太多的注释。
<?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"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<!-- PrimeFaces -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<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>*.xhtml</url-pattern>
</servlet-mapping>
<!-- "normal" Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/applicationContext.xml
classpath:spring/security.xml
</param-value>
</context-param>
<!-- Spring security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/springsecurity.taglib.xml</param-value>
</context-param>
<!-- filterchain -->
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Error Page 404 -->
<error-page>
<error-code>404</error-code>
<location>/error.xhtml?errorID=404</location>
</error-page>
</web-app>