Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Deprecated method(s) in HttpSession

843833May 13 2002 — edited May 15 2002
Hi,

I need some information regarding HttpSession. I am working with JDK 1.2.2 and JSDK 2.0

In one of my classes i am trying to put a key - value pair in session and trying to get the same
whereever required in this fashion.

...
...
...
String MY_ID = "myid";
String Id = "100000000";
HttpSession newSession = pReq.getSession(true);
// putting id value in the session
newSession.putValue(MY_ID,Id);

// i am trying to get Id value in this fashion
HttpSession currentSession = pReq.getSession(false);
String id = (String)currentSession.getValue(MY_ID);

While Compiling i am getting one warning that i am using deprecated methods (putValue and getValue) on HttpSession object.

Are these methods deprecated ? If yes, what are other possible alternatvies to put and get
some data in session ?
I know cookies is one alternative which strikes to mind for such requirements. But i want
something other than cookies....

Thanks in advance,
Kishore
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2002
Added on May 13 2002
2 comments
296 views