HTTP request isrequestsessionIdvalid() function problem

Hi,

To check the expiration of the HTTPSession , i have used in my Controller servlet , a check as:

if (!isRequestSessionIdValid()){

out.println("Session has expired!!!")

}

however the above piece creates problem,As I type the URL and hit ENTER the control reaches to controllerservlet, and to my suprise it prints the message As "Session has expired!!!"

.

However, when I again hit the URL on the same browser window, the session id is generated and code works fine.

I am using app server 7.

Any pointers is highly appreciated!!!

Thanks in Advance

Kartic

[628 byte] By [Kartic] at [2007-11-26 6:48:13]
# 1

Hi,

If the context has not been set before you call isRequestSessionIdValid(), it will return false. i.e. you must call

HttpRequestBase.setContext() before isRequestSessionIdValid().

Please try this, and if you are still having problems please paste all of the relevant servlet code in your next post.

Hope this helps

roho at 2007-7-6 15:11:55 > top of Java-index,Application & Integration Servers,Application Servers...