我注意到有几个问题关于这个话题。我翻看了他们,我无法将它们应用到我的特定的Spring设置。我想根据用户的角色将我的登录重定向配置为有条件的。这是我到目前为止有:Spring Security条件default-target-url
<http auto-config="true" use-expressions="true">
<custom-filter ref="filterSecurityInterceptor" before="FILTER_SECURITY_INTERCEPTOR"/>
<access-denied-handler ref="accessDeniedHandler"/>
<form-login
login-page="/login"
default-target-url="/admin/index"
authentication-failure-url="/index?error=true"
/>
<logout logout-success-url="/index" invalidate-session="true"/>
</http>
我想this question可能是在同一行什么,我试图做的。任何人都知道我可以如何应用它?
编辑1
EDIT 2
目前我没有像public class Test implements AuthenticationSuccessHandler {}
类如图this example。
你的问题是相同的[这一个](http://stackoverflow.com/questions/7470405/authenticationsuccesshandler-example-for-spring-security-3) – 2012-08-13 10:42:41
谢谢。你可以检查**编辑1 **。我感到困惑,因为我已经为该bean分配了一个spring类? – ThreaT 2012-08-13 11:08:57
还没有形成 - 登录authenticationSuccessHandler? http://static.springsource.org/spring-security/site/docs/3.0.x/reference/appendix-namespace.html – 2012-08-13 11:16:25