Title: RE: Need help on Sessions

> Just use session.getValue("session_object_name")
> The value returned is of String type.

That's not entirely correct: the value returned is of type Object. You must cast it to the type you want it to be:

MyObject myObject = new myObject();
HttpSession mySession = request.getSession(true);
mySession.putValue("MyKey", myObject);

then later you can do:

MyObject myObject;
HttpSession mySession = request.getSession(true);
my0bject = (MyObject)mySession.getValue("MyKey");

Regards,
Patrick.

Reply via email to