@RequestMapping(value = "/start") public String start(String email, String password, HttpSession session) { Boolean loginResult = fellowService.verify(email, password); if (loginResult) { Fellows fellow = fellowService.read(email); session.setAttribute("fellowSeq", String.valueOf(fellow.getFellowSeq())); session.setAttribute("id", fellow.getId()); session.setAttribute("nickname", fellow.getNickname()); session.setMaxInactiveInterval(3600); return "redirect:/dashboard/view"; } else return "redirect:login?result=failure"; }
@RequestMapping(value = "/register", method = RequestMethod.POST) public String register(@Valid Fellows fellows, Errors errors) { if (errors.hasErrors()) return "/session/register"; fellowService.create(fellows); return "redirect:login"; }