SHARE
TWEET

Untitled

a guest Jun 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top