*/
@Override
public void postHandle(HttpServletRequest request,
- HttpServletResponse response, Object handler,
- ModelAndView modelAndView) throws Exception {
- modelAndView.addObject("acc", this.accountService.getCurrentAccount());
- modelAndView.addObject("loginurl", Sht.loginUrl(request));
- modelAndView.addObject("logouturl", Sht.logoutUrl(request));
+ HttpServletResponse response, Object handler, ModelAndView mav)
+ throws Exception {
+ // リダイレクトする場合は不要
+ if (!mav.getViewName().startsWith("redirect:")) {
+ mav.addObject("acc", this.accountService.getCurrentAccount());
+ mav.addObject("loginurl", Sht.loginUrl(request));
+ mav.addObject("logouturl", Sht.logoutUrl(request));
+ }
}
}
*/
@Override
public void postHandle(HttpServletRequest request,
- HttpServletResponse response, Object handler,
- ModelAndView modelAndView) throws Exception {
- final String token = RandomStringUtils.randomAlphanumeric(128);
-
- request.getSession().setAttribute("secureToken", token);
- modelAndView.addObject("secureToken", token);
+ HttpServletResponse response, Object handler, ModelAndView mav)
+ throws Exception {
+ // リダイレクトする場合は不要
+ if (!mav.getViewName().startsWith("redirect:")) {
+ final String token = RandomStringUtils.randomAlphanumeric(128);
+ request.getSession().setAttribute("secureToken", token);
+ mav.addObject("secureToken", token);
+ }
if (request.getMethod().equals("POST")
&& handler instanceof IController) {