Hi ,
I am using spring mvc 2.5 and annotaton based.
Can anybody advice me what is the best approch for handling the expired http session and redirecting teh user to login page with valid error message?
In my controller I use
I am gettingCode:@Controller @SessionAttributes ({"user","dmsUser"}) @RequestMapping("/userDetails.do") public class UserController { =========================== and handler method @RequestMapping(method = RequestMethod.GET) public String setUpForm(@RequestParam("userId") String userId, @ModelAttribute("user") DMSUser user, Model model) { logger.info("Loading User details"); String forward = ""; if(userId==null||Integer.parseInt(userId)==0){ if (user == null || user.getPermissions().get("manageuser") < 2) { model.addAttribute("message", "unauhorized operation"); return "dmsHome"; } else{ model.addAttribute("dmsUser", new DMSUser()); model.addAttribute("roles", userService.getRoles()); return "dmsUserDetails"; } } ......
org.springframework.web.HttpSessionRequiredExcepti on: Session attribute 'user' required - not found in session
Once the session expired
Thanks in advance
Shaiju


Reply With Quote