0

我有春季安全问题。

我终于糊涂了。我想这样做:

1.调用后spring_secutity_check

a) 如果登录名和密码正确 - 转到/successLogin

b) 错误的凭据 - 转到/badLogin

2 调用后j_spring_security_logout 转到/logouUrl

您能根据我的情况帮助配置配置吗?

4

2 回答 2

0

请参阅“Spring in action ch:9 page no 230”

于 2013-10-08T08:11:49.767 回答
0
<beans:beans xmlns="http://www.springframework.org/schema/security"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:beans="http://www.springframework.org/schema/beans" 
             xsi:schemaLocation="
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">

    <!--
    ......
    -->

    <http auto-config="true">
        <form-login 
            login-page="/login" 
            default-target-url="/successLogin"
            authentication-failure-url="/badLogin" />
        <logout logout-success-url="/logoutUrl" />
    </http>

    <!--
    ......
    -->

</beans:beans>
于 2013-10-08T10:25:43.833 回答