我有问题wuth spring security。
我终于感到困惑。 我想这样做:
1.在调用spring_secutity_check
a)如果有良好的登录名和密码 - 请转到/successLogin
b)错误的凭据 - 转到/badLogin
j_spring_security_logout
转到/logouUrl
您能帮忙配置我的条件配置吗?
答案 0 :(得分:0)
参考“Spring in action ch:9 page no 230”
答案 1 :(得分: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>