problem with session.invalidate

Hi,

I have to display a final screen(last screen of the application) and then invalidate the session. The problem is where should I put my session.invalidate() code. I am populating the data to be displayed on the screen within the constructor of the backing bean. When I put session.invalidate() in the last part of constructor code, I get"java.lang.IllegalStateException: Session was invalidated" error. How do I invalidate the session and also display the data in the final screen.

[497 byte] By [Jatin_Kulkarnia] at [2007-11-27 1:51:48]
# 1
put <% session.invalidate(); %> in your logout.jsp (at the end for instance)
reinanto3a at 2007-7-12 1:19:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I put the code <%session.invalidate(); %> in my last JSP page but the same error still occurs.
Jatin_Kulkarnia at 2007-7-12 1:19:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
You can add a "really" last JSP-page (no JSF-stuff, only JSP-style) with the <%session.invalidate() %> line.On your last JSF-page add a little JavaScript that redirects to that last-JSP page (perhaps after 2 or 3 seconds)...
UlrichCecha at 2007-7-12 1:19:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

I am facing a similar problem in the login module. When an already logged in user tries to login, I need to invalidate the earlier session and then create new session, without losing the request data(login name, password, etc) that comes in from the login page. How do I achieve this functionality.

Jatin_Kulkarnia at 2007-7-12 1:19:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...