This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Java API docs say : If create is false and the request has no valid HttpSession, this method returns null.
I click at hyperline two in one.jsp after the session is expired (2 minutes in this case). When the control goes to two.jsp, it creates a new session, but since the session has expired, i should get null(according to API docs) and not new session object. [ June 21, 2006: Message edited by: Marc Peabody ]
I'm going to close your other threads related to this very problem. Please try to keep all questions related to a single problem in a single thread.
LOOK HERE! ******************** JSPs create a new session by default. If you want your second JSP to not automatically create a new session you must specify this directive in the second JSP: <%@ page session="false"> ******************** [ June 21, 2006: Message edited by: Marc Peabody ]
A good workman is known by his tools.
Joined: May 18, 2005
If i want to do the same thing in servlets, then how i can do it!!!.
Servlets do not create a session by default. There are no special directives or other tricks necessary to make the same thing work in a servlet. I'm assuming that's what you're asking.
Joined: May 18, 2005
yes thats true, but the problem i am facing is that once my session is expiring sessionDestroyed(HttpSessionEvent sessionEvent) of HttpSessionListener is called. Now the user is not aware that the session has expired or not... if he clicks at any of the hyperlinks (after the session is expired), then i have to check whether the session is expired. I do it by using request.getSession(false) to redirect him to sessionExpired.jsp. But the problem is request.getSession(false) creates a new session for the same user (Browser, the sessionID of new session is different from first one). So i have no way to know that the session has expired .......to take appropriate action
Thanks for helping Satou, but as there are at least 38 people with the surname Chaurasia in the New York state alone (picking a state at random), it is quite possibly N Chaurasia's real name. And we do allow initials for the first letter.