aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 12678
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.

Java Resources at
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: 613
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
Similar Threads
getting session null instead of creating new session.
Unavailable session in Controller Servlet.....
Getting Session as null
Confusion about session destruction
Communication session , servlet applet and back from applet servlet and session