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

The Session  RSS feed

 
John Miller
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, one of my servlets use the following code (session.putValue("accesslevel", "10"), session is declared with HttpSession = request.getSession().
If if want to access the value I just placed into the session in another servlet what do i do? At the moment I'am using session.getValue("accesslevel"), but it only return null.
Points to note:
I know getValue() and putValue() are decrecated, I tried using setAttribute() and getAttribute but the results where the same.
Im using JRUN and everyting is set up perfecting.
Im using Internet Explorer 5.5.
Thanks
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to creatre the session new use HttpSession = request.getSession(true), else to get to the current session if there is one, use HttpSession = request.getSession(false).
I am not sure if you can create/access a session without a boolean parameter to the getSession method.

Bosun
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!