File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes Servlets and the session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Servlets and the session" Watch "Servlets and the session" New topic
Author

Servlets and the session

John Miller
Greenhorn

Joined: May 24, 2001
Posts: 12
Hi,
I have one servlet that is used for forwarding requests to other classes. Let say the main servelt gets called, it evaulates the paramaters and forwards it to the appropriate clas(eg. login class).
In the login class i get the session and save the users accesslevel into the session. Here is the code snipet:
HttpSession session = req.getSession(true);
session.putValue("access", access);
Now when the user does something(eg. clicking the list button) the servlet calls the list class, i then try and get the session with the following code, but it doesnt work.
HttpSession session = req.getSession(false);
Any ideas
I using the newest version of JRUN and everything is set up perfectly.
Johannes de Jong
tumbleweed
Bartender

Joined: Jan 27, 2001
Posts: 5089
This is not an appropriate post for the "Cattle Drive (java college)" forum, so I've moved it to "Servlets and JSP's".
I also see that you have posted the same question in the "Developer Certification" forum. I must point out that its our policy that you post a specific question only once.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets and the session
 
Similar Threads
Session does not persist
Servlets
Pass session from JSP to servlet?
Exact Front Controller In Realtime
Servlets and the session