clearAuthenticationAttributes(request);
if (user.isClientRole()) {
response.sendRedirect(loginSuccessUrl
.get(ConstValueUtil.CUR_CLIENT));
} else if (user.isLawyerRole()) {
response.sendRedirect(loginSuccessUrl
.get(ConstValueUtil.CUR_LAWYER));
} else if (user.isAgentRole()) {
response.sendRedirect(loginSuccessUrl.get(ConstValueUtil.CUR_AGENT));
} else if (user.isAdminRole()) {
response.sendRedirect(loginSuccessUrl.get(ConstValueUtil.CUR_ADMIN));
} else {
response.sendRedirect("home");
}
}
配置的,没你怎么复杂,也没继承SavedRequestAwareAuthenticationSuccessHandler 类。
你这个
<beans:entry key="CUR_LAWYER" value="lawyer/index" />
<beans:entry key="CUR_AGENT" value="agent/index" />
<beans:entry key="CUR_CLIENT" value="client/index" />
<beans:entry key="CUR_ADMIN" value="admin/index" />
是CUR_ADMIN权限跳到admin/index,CUR_CLIENT跳到client/index,这样吗?
我做了个简单例子
SavedRequest savedRequest = this.requestCache.getRequest(request, response);
savedRequest 不会为null呀。
你继承这个SavedRequestAwareAuthenticationSuccessHandler 的目的是什么?
SavedRequestAwareAuthenticationSuccessHandler 有個property "defaultTargetUrl"
請再spring security.xml 設定 加
<property name="defaultTargetUrl" value="/xxxxx.htm" />
上一页 [1] [2]