I set an object into an HttpSession
. This object is an instance of class User
. Then, in another class I'm trying to do something like this:
User user = session.getAttribute("userObject");
I read about Serializable
but I can't understand how it works. Is there a direct and easier way to do this?