dcsimg
Servlet and HTTPSession.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Yurik_Siva
Posted On:   Monday, December 3, 2001 07:27 PM

Hi, Could somebody help me? I access same servlet from two different pages. First page sitting on the root directory and second page in subfolder of the same directory. The problem - when I access servlet from the first page request.getSession(false) return NULL, and if I access servlet from the second page I'm getting session object without problem. Why the session not available on the first page? And how to make session available for all my pages? NOTE: This situation happens only on server. When I running my local computer I don't have this problem. Thanks.    More>>

Hi,


Could somebody help me?

I access same servlet from two different pages. First page sitting on the root directory and second page in subfolder of the same directory.

The problem - when I access servlet from the first page

			
request.getSession(false)

return NULL, and if I access servlet from the second page I'm getting session object without problem.

Why the session not available on the first page?
And how to make session available for all my pages?

NOTE: This situation happens only on server. When I running my local computer
I don't have this problem.

Thanks.    <<Less

Re: Servlet and HTTPSession.

Posted By:   Jody_Brown  
Posted On:   Tuesday, December 4, 2001 04:02 AM


request.getSession(false) will return null if a session doesnt exist. It makes sense that this is happening on your first page because that is exactly the case. No session exists.



Replace "false" for "true". Then a new session will be created for you if one doesnt exist.

About | Sitemap | Contact