Questions tagged [viewexpiredexception]

An exception type that is commonly thrown by the JavaServer Faces (JSF) framework

This exception will be thrown whenever the enduser fires a POST request on a view which does not exist anymore in the server side, because the session has been expired. The view states are by default stored in the session, so they are lost whenever the session expires. A POST request will be fired when the enduser clicks a command button or command link or fires a JSF ajax request.

This can happen when you keep a page open in browser and untouch it for too long so that the session expires (usually, that is 30 minutes, depending on server configuration). Firing a POST request on such a view after session expiration will then result in ViewExpiredException. This can also happen when the browser loads the page from its cache instead of from the server.

They can be handled by <error-page> in web.xml or a custom ExceptionHandler. They can if necessary be avoided by setting the context parameter javax.faces.STATE_SAVING_METHOD to client instead of (default) server which would then save the serialized view state as a hidden input field value of the POST form. With server side state saving, the browser also needs to be instructed to not cache the dynamic JSF pages.

Frequently asked questions:

115 questions
1
vote
2 answers

javax.faces.application.ViewExpiredException seemingly ignored

I've put the following into my web.xml: javax.faces.application.ViewExpiredException /expiredIndex.jsf
volvox
  • 3,014
  • 16
  • 51
  • 80
1
vote
2 answers

Unable to resolve ViewExpiredException through web.xml in JSF 2.2

I am trying to resolve an apparently simple issue but so far no success. I am developing a web application in JSF 2.2 with PrimeFaces 5.3 and tomcat 8 . I am trying to deal with ViewExpiredException, so that I can redirect the user to index or…
1
vote
0 answers

ViewExpiredException: View could not be restored when user is logged in again

My web app is built on spring boot + spring security + JSF 2.2.12 I have read a lot of posts about the view expired exception, and try to solve it using this proposal. To be shortly, I have added ?faces-redirect=true to my action methods, added…
Hutsul
  • 1,535
  • 4
  • 31
  • 51
1
vote
0 answers

Wildfly 8.2.0 : ViewExpiredException not thrown

My JSF application (Primefaces 5) which runs on Wildfly 8.2.0 cannot catch viewExpiredException when my pages are under security-constraint. It seems that the server does not throw javax.faces.application.ViewExpiredException after session…
1
vote
1 answer

Why the fields in my login page disappear when I redirect after a ViewExpiredException?

I add the following lines to web.xml 1 javax.faces.application.ViewExpiredException
StudioWorks
  • 483
  • 1
  • 6
  • 25
1
vote
1 answer

ViewExpiredException immediately after logging

I read that it is a problem of expired session, but in my case it's impossible because the session was just opened when the exception is thrown: I get to login page, fill up form and submit. After that I get ViewExpiredException. What can I do to…
kuba44
  • 1,838
  • 9
  • 34
  • 62
1
vote
2 answers

JSF2 NullPointerException instead of ViewExpiredException

I use Mojarra 2.2.2, PrimeFaces 4.0, OmniFaces 1.7, Tomcat 7, Weld. Following stacktrace appears when session expires on server and ajax request is sent: java.lang.NullPointerException at…
Neutrino
  • 21
  • 1
  • 6
1
vote
2 answers

Java ee session/conversation/view timeout redirection

My environment is: NetBeans7.2.1, GlassFish3.1, JSF2 and Weld 1.1.0. I'm trying to redirect to an error page in one of these cases ( session/conversation/view timeout ). From what I read there are number of options: Using inside…
user2046810
  • 393
  • 1
  • 8
  • 21
1
vote
1 answer

Redirect on ViewExpiredException passing page parameters for Seam 2.2.0

For a Seam application, I am trying to pass page parameters after encountering a ViewExpiredException in pages.xml (session time out) on the redirect view but they get dropped when the browser redirects to the view.
Adit
  • 103
  • 1
  • 3
1
vote
1 answer

jsf view expired imply session destroyed?

I have a question : When jsf view has expired, can we be sure that the session is destroyed and all its attributes are removed ? Thank you for responding me.
ThunderPhoenix
  • 1,649
  • 4
  • 20
  • 47
1
vote
1 answer

Unexpected error forwarding or redirecting to login page

I have a JSF app running on GlassFish 3.1.2.2 with Mojarra 2.1.21 and OmniFaces 1.4.1 to handle Ajax errors. The app has both protected and public areas, using form-based-authentication (on a JSF form) with programmatic login. I'd always get a blank…
1
vote
1 answer

JSF 2.1 + CDI handling ActionEvent throws ViewExpiredException

I'am trying to run simple example of my web app. I'am using JSF + CDI bean. My facelet:
cygus
  • 11
  • 1
1
vote
1 answer

ViewExpiredException - why different behaviour?

I have a JSF 2 application and configured the following in web.xml: javax.faces.application.ViewExpiredException /error.html For testing purposes I…
Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96
1
vote
1 answer

Simple jsf2.0 application : javax.faces.application.ViewExpiredException View could not be restored

In a simple jsf2.0 application,I am getting this exception :javax.faces.application.ViewExpiredException View could not be restored. In console I am getting following error: org.portletfaces.bridge.BridgeException: Must first call…
Bosco
  • 3,835
  • 6
  • 25
  • 33
1
vote
1 answer

javax.faces.application.ViewExpiredException: During load test

We are Using SUN JSF 1.2, WebSphere 7.0 for our application, we are getting ViewExpiredException only during the load testing I have gone through the below link javax.faces.application.ViewExpiredException: View could not be restored Have followed…
Hariharbalaji
  • 2,498
  • 8
  • 36
  • 51