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 urgent - session 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 "urgent - session null" Watch "urgent - session null" New topic
Author

urgent - session null

Nitin Gogia
Greenhorn

Joined: Jan 17, 2003
Posts: 22
Hi,
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 session is null. I am not able to figure out why i am getting the session as null. I am using encodeURL to encode the link (in order to append session id). Also this problem is not consistent. Sometimes it works and other times i get session as null.
Please help.
Regards,
Nitin
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
It sounds like your JSP and the servlet that serves the image are not in the same web application so the session is not shared.
Bill
Nitin Gogia
Greenhorn

Joined: Jan 17, 2003
Posts: 22
They are a part of same web application. Also i mentioned that it works sometimes but most of the times it gives session is null. Therefore difficult to trace.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 640
There is chance that session is expiring by time
you get to image servlet....
Praful
[ March 12, 2003: Message edited by: Praful Thakare ]

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: urgent - session null