JSF登录中的j_spring_安全检查404错误

JSF登录中的j_spring_安全检查404错误,jsf,authentication,jsf-2,spring-security,Jsf,Authentication,Jsf 2,Spring Security,我正在为spring安全认证创建一个简单的jsf登录表单: <form action="#{request.contextPath}/j_spring_security_check" method="post"> <h:outputLabel for="j_username" value="Username"/> <h:inputText id="j_username"/> <br/> <h:outputLab

我正在为spring安全认证创建一个简单的
jsf登录表单

<form action="#{request.contextPath}/j_spring_security_check" method="post">
    <h:outputLabel for="j_username" value="Username"/>
    <h:inputText id="j_username"/>
    <br/>
    <h:outputLabel for="j_password" value="Password"/>
    <h:inputSecret id="j_password"/>
    <br/>
    <h:commandButton value="Login"/>
</form>
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
              http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security.xsd">

    <security:http auto-config="true" use-expressions="true">
        <security:intercept-url pattern="/login.xhtml" access="hasRole('IS_AUTHENTICATED_ANONYMOUSLY')"/>
        <security:intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
        <security:form-login login-page="/login.xhtml" default-target-url="/" authentication-failure-url="/login?login_error=1"/>
    </security:http>

    <security:authentication-manager>
        <security:authentication-provider>
            <security:user-service>
                <security:user name="sajjad" password="200200" authorities="ROLE_USER"/>
            </security:user-service>
        </security:authentication-provider>
    </security:authentication-manager>
</beans>
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</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>*.xhtml</url-pattern>
</servlet-mapping>
<application>
    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>

代码有什么问题?

登录处理url=“/j_spring\u security\u check”
添加到

尝试将
请求添加到springSecurityFilterChain映射中