Share session between two servlet
843840Nov 9 2002 — edited Nov 10 2002hi all
I create a session in one servlet and i use another servlet to get the session in the same browser but it fail.
what is the code for get the session?
//Create session
String USER = "USER"
session.putValue(USER, ulog);
HttpSession session = req.getSession(true);
ulog = new User(); //User is a class
session.putValue(USER, ulog);
//Get session
String USER = "USER";
HttpSession session = req.getSession(true);
User ulog = (User) session.getValue(USER); //User is a class, this line fail
What wrong in the Get session part?