Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

session.invalidate causing pblms

843835Nov 29 2001 — edited Dec 1 2001
Hi there,
I am having problems in redirection/forwarding after invalidating the session and creating a new one.
The situation is very simple. When user choses to "Logout" the session is invalidated and redirected to the login page again. Now when user tries to log in again, I am getting:
unable to dispatch to the url : NullPointerException.
This is what I tried:
session.invalidate();
session = request.getSession(true);
if ((session != null)&&(session.isNew()))
{
System.out.println("new session created");
response.sendRedirect("first.jsp");
}
else
System.out.println("session not created");

Is is that I cannot redirect after invalidating the session!!!
Doesnt make sense to me.
Suggestions and ideas please,
RG
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2001
Added on Nov 29 2001
4 comments
155 views