File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "urgent - session null" Watch "urgent - session null" New topic

urgent - session 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 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.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.
Nitin Gogia

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: 642
There is chance that session is expiring by time
you get to image servlet....
[ 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:
subject: urgent - session null
It's not a secret anymore!