毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> java技术 >> 正文

Spring security3.1.0实现登陆后跳转至登录前页面

更新时间:2012-6-15:  来源:毕业论文

@Service
public class AuthenticationSuccessHandler extends
SavedRequestAwareAuthenticationSuccessHandler {

该类中的onAuthenticationSuccess方法如下:
每次获取为空:SavedRequest savedRequest = this.requestCache.getRequest(request, response);
saveRequest为Null,求解,大神帮忙呀!


@Override
public void onAuthenticationSuccess(HttpServletRequest request,
HttpServletResponse response, Authentication authentication)
throws ServletException, IOException {
bindUserToSession(request);
User user = (User) request.getSession().getAttribute(
ConstValueUtil.CUR_USER);


SavedRequest savedRequest = this.requestCache.getRequest(request, response);

  if (savedRequest == null) {
  super.onAuthenticationSuccess(request, response, authentication);
  return;
  }

  if (isAlwaysUseDefaultTargetUrl()
  || StringUtils.hasText(request
  .getParameter(getTargetUrlParameter()))) {
  this.requestCache.removeRequest(request, response);
  super.onAuthenticationSuccess(request, response, authentication);
  return;
  }

// List<User> onlineLawyers = userService.getOnlineLawyers();
// request.getSession().setAttribute("onlineLawyers", onlineLawyers);

saveLoginHistory(user, request);

[1] [2] 下一页

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。