Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting HttpSession object from SessionContext

 
Ravissant Markandey
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

Can anyone tell me how i can get the HttpSession object from session context??

Also i dont even have the session id so context.getSession(sessionId) is ruled out.

Thanks,
Ravissant
[ November 20, 2008: Message edited by: Ravissant Markandey ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're talking about the HttpSessionContext it's been deprecated so I wouldn't write code that uses it now.

Even if it weren't deprecated, there is no way to get a reference to a specific session object without having its ID.

Maybe if you tell us a little more about what it is that you're trying to accomplish, someone can suggest another approach.
 
ou yang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with ben's points.the specific session object has no ID.it is used to rewrite the URL and you can store the variable parameter in the session scope.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ou yang:
I agree with ben's points.the specific session object has no ID.it is used to rewrite the URL and you can store the variable parameter in the session scope.


Sessions do have IDs.
In this case the OP (Original Poster) was asking about retrieving a reference to the session without knowing its ID.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic