Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误404带primefaces的Spring Security 4.0_Spring_Primefaces_Spring Security - Fatal编程技术网

错误404带primefaces的Spring Security 4.0

错误404带primefaces的Spring Security 4.0,spring,primefaces,spring-security,Spring,Primefaces,Spring Security,我正在使用一个带有Spring、Spring Security、hibernate和primefaces的web应用程序。 问题在于身份验证:当我不创建登录页面时,Spring security会自动创建一个登录页面,并且一切正常,但当我创建login.xhtml页面时,我遇到了以下错误:错误404 j_Spring_security_check login.xhtml页面: <form action="j_spring_security_check" method="POST">

我正在使用一个带有Spring、Spring Security、hibernate和primefaces的web应用程序。 问题在于身份验证:当我不创建登录页面时,Spring security会自动创建一个登录页面,并且一切正常,但当我创建login.xhtml页面时,我遇到了以下错误:错误404 j_Spring_security_check

login.xhtml页面:

<form action="j_spring_security_check" method="POST">
<fieldset>
    <legend>Connexion</legend>
    <p>
        <label>Login:</label>
        <input type="text" name="j_username"/>
    </p>
    <p>
        <label>Password:</label>
        <input type="password" name="j_password"/>
    </p>
    <br/>
        <input type="submit" value="Sign In"/>

    </fieldset>
</form>

连接

登录:

密码:


My applicationContext.xml包含Spring安全配置,位于Web Inf文件夹中,配置良好

<s:http pattern="/resources/**" security="none" />
<s:http use-expressions="true">
    <s:intercept-url pattern="/login.xhtml" access="permitAll" />

    <s:intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" />
    <s:intercept-url pattern="/nota/**" access="hasRole('ROLE_USER')" />
    <s:session-management>
        <s:concurrency-control max-sessions="1"
            error-if-maximum-exceeded="true" />
    </s:session-management>
    <s:csrf disabled="true"/>
    <s:form-login login-page="/login.xhtml"
        authentication-failure-url="/login.xhtml"
        authentication-success-handler-ref="myAuthenticationSuccessHandler" />
    <s:logout invalidate-session="true" delete-cookies="JSESSIONID"
        logout-success-url="/login.xhtml" />
</s:http>
<bean id="myAuthenticationSuccessHandler"
    class="primefaces.test.authentification.MySimpleUrlAuthenticationSuccessHandler" />



<s:authentication-manager>
    <s:authentication-provider>
        <s:user-service>
            <s:user name="jimi" password="jimi" authorities="ROLE_ADMIN" />
            <s:user name="bob" password="bobspassword" authorities="ROLE_USER" />
        </s:user-service>
    </s:authentication-provider>
</s:authentication-manager>


有人能帮我吗?请

我通过将spring和spring sec版本更改为3.2.4解决了问题
一切正常

这是如何关联的?我只看到纯html?我已经使用primefaces组件的登录表单,但我得到了相同的错误。另外,问题与primefaces、jsp或xhtml无关,而是与资源j_spring_security_Check有关,您的spring安全配置是什么样子的?好的,我将更新问题spring Sec conf似乎不错,因为如果我不指定登录页面,一切正常!