Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. @Controller
  2. @RequestMapping(value = "/login")
  3. public class Login{
  4.  
  5. @RequestMapping
  6. public ModelAndView mainPage(HttpServletRequest request){
  7.  
  8. request.getSession().setAttribute("testSession", "Session test");
  9.  
  10. return new ModelAndView("/login");
  11.  
  12. }
  13.  
  14. @RequestMapping(value = "/check")
  15. public View check(HttpServletRequest request){
  16.  
  17. System.out.println(request.getSession(false)); //null
  18.  
  19. return new RedirectView("/login");
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement