This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Getting Session as null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Getting Session as null" Watch "Getting Session as null" New topic

Getting Session as null

Nitin Gogia

Joined: Jan 17, 2003
Posts: 22
In a application; i have a JSP page which contains a link which points to servlet which serves the image.
Now the problem is when a servlet is called i get HTTP 401 - Unauthorized error and session is also null. I am not able to figure out why i am getting the session as null. I am using encodeURL to encode the link. Also this problem is not consistent. Sometimes it works and sometimes i get session as null and HTTP 401 error.
Please help.
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
401 sounds strange. if you get null from your session, but it doesn't happen always, what is the chance your session just times out?
you can also post your code here.

Asher Tarnopolski
jQuery in Action, 2nd edition
subject: Getting Session as null