aspose file tools
The moose likes Servlets and the fly likes The Session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "The Session" Watch "The Session" New topic
Author

The Session

John Miller
Greenhorn

Joined: May 24, 2001
Posts: 12
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

Joined: Nov 06, 2000
Posts: 1506
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


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: The Session
 
Similar Threads
Servlets
Servlets and the session
Problem with global.jsa using Oracle 9ias
Session does not persist
Servlets and the session