You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by smokeJag <nc...@sabioso.com> on 2008/05/23 20:02:34 UTC

ViewState in relation to new sessions when the user clicks the back button

Here's my question.  I've spent a good 2 days looking for a similar
question/solution without luck.  

A user logs into the application, and they get to a welcome page where they
sit idle until their session expires.  When they finally decide to click on
anything, they are redirected back to the login page, and they are given a
new session.  Now (for whatever reason) they decide to click the back button
on the browser a few times to get back to the welcome page.  Now when they
try and click on anything, they don't get a session expired error (because
they have a new session) but they get a SEVERE: Could not find saved view
state for token -e02c3d2, with a viewExpiredException as the ultimate
culmination of the errors.

I would like to be able to trap this error and treat it the same way that an
expired session is treated, however I'm having no luck.  

I've tried this in my web.xml (I get the error same error as it tries to
redirect to the login.jspx)
<error-page>
        <exception-type>
              javax.faces.application.ViewExpiredException
        </exception-type>
        <location>
            /faces/sessionExpired.jspx
        </location>
 </error-page> 

I've tried catching the exception in a filter (which didn't work -- filters
run too early)
I've tried messing with session in a backing bean (which also didn't work --
bb gets instantiated after restoreView phase where the error occurs.)

Any direction or suggestions would be very much appreciated!

Nate
-- 
View this message in context: http://www.nabble.com/ViewState-in-relation-to-new-sessions-when-the-user-clicks-the-back-button-tp17430847p17430847.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.