Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Actually wht is a session????  RSS feed

 
Hrithik Roshan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m tryin to create a new session which a brand new SEARCH every time a user clicks;
damn
i m lost i cud not make it;
and when i print the session ID;
it always gives me the same session id;
help me!!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not what sessions are for. Sessions are explicitly persistant in that way so that you can maintain state between HTTP requests -- HTTP being a stateless protocol.
What you can do is to create a bean or other class that encapsulates the search data you want to store and stick that on the session as an attribute. You can then change this attriibute as often as you like.
hth,
bear
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what your asking, but if you want a new session you could always invalidate the old by calling invalidate() on the session object. Then create a new session by request.getSession(true)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!