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
0
votes
2 answers

ViewExpiredException in landing page of a JSF application

I have an application built using JSF1.2. I have a home page which has a set of command links. After I deploy the application , when open the home page and click on any of these menu links - I get the below exception. However if I navigate to other…
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
0
votes
0 answers

JSF 2.0; Navigation between ViewScope and RequestScrope throws ViewExpiredException

I've got two pages on my JSF application. page1 is requestscoped and has a form on its site page2 is viewscoped and shows the values from page1 which are entered From page1 to page2 i'm using flashscope to transfer the input data. That works fine,…
Tobi
  • 1,440
  • 1
  • 13
  • 26
0
votes
1 answer

Login required twice after logging out due to ViewExpiredException

I have a JSF page on Websphere Process Server (on top of WAS 7) which has ViewExpiredException. When this happens I want the user to be logged out and then logged back in I've set up a redirect on this exception in web.xml to the following logout…
Laila Agaev
  • 1,782
  • 1
  • 10
  • 19
0
votes
1 answer

View could not be restored after clicking button that runs a JS function which clears the form

I'm having an issue with a form that I have. The form allows users to enter info into some textboxes and then there are 2 buttons - Search and Reset. Form code:
Catfish
  • 18,876
  • 54
  • 209
  • 353
0
votes
1 answer

PrimeFaces 3.0 + Mojarra 2.1.6 javascript ajax package jsf.ajax.* not available - ViewExpiredException

I've tried to investigate the problem but haven't found solution at all. I use primefaces datatable with pagination. I wrote and exception handler for viewexpiredexception error as Ed Burns suggested in his blog but when used in combiation with ajax…
crick77
  • 65
  • 8
0
votes
2 answers

jsf page could not be restored

I get this error when I click on a selectBooleanCheckBox. What should I do? 10:36:03,105 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/snsEJBwm].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception:…
mitran
  • 1
  • 1
0
votes
0 answers

Custom JSF ExceptionHandler does not work

I have a JSF application, with PrimeFaces. My app run on WildFly I mus redirect the user to the login page, if the session expired. I have written an CustomExceptionHandler: The ExceptionHandlerFactory: public class ExceptionHandlerFactory extends…
Károly Neue
  • 89
  • 2
  • 9
0
votes
1 answer

Facing myFaces error when migrating from WAS8 to WAS9?

We are currently migrating our application from WAS8 to WAS9. We use JSF 2.2 and Primefaces 4.0. In WAS8 application works fine.But in WAS9 we are getting the following error: Uncaught service() exception root cause Faces Servlet:…
Padmaja
  • 111
  • 1
  • 11
0
votes
0 answers

View Expired Exception - No saved view state

I am pulling my hairs over it and i know it was discussed here millions times.. after reading dozens questions here regarding this topic and trying them.. result is still same, this exception is not handled and not redirected to my custom error…
10101101
  • 193
  • 1
  • 13
0
votes
0 answers

Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@7c8ce10f]

I am serializing all the data in the session and storing the session data outside the JVM using tomcat persistence manager in the DB tables. Without persistence manager everything is working fine. But with the perisitence manager for this session…
Mohammed Javad
  • 629
  • 8
  • 18
0
votes
1 answer

Why does selecting the browser Refresh button not replace edited fields in my JSF form with values from server?

During normal operation, everything works well on my Java EE note taking application running on GlassFish 4.1.2 with STATE_SAVING_METHOD set to server. I can open the ViewScoped Note.xhtml client in my Firefox browser; type text in the CKEditor…
Reed Elliott
  • 223
  • 2
  • 15
0
votes
0 answers

"No saved view state could be found..." after doubleclick on logout

I have an application with a logout button. After I doubleclick the button, I get a ViewExpiredException: An unexpected exception was caught during processing the request: javax.faces.application.ViewExpiredException:…
sinned
  • 503
  • 1
  • 7
  • 25
0
votes
0 answers

Session-timeout in web.xml not working

I am new to JSF and working on session-timeout and based on it redirecting to a logout page. But it is not working properly and showing unusual behavior like, some times it's getting redirected and some times it's not... Code for…
Brock
  • 1
  • 1
0
votes
1 answer

jsf view expired error when using reverse proxy

I'm writing an EAI (External Authentication Interface) solution that provides Login/Logout pages for some applications We currently have a F5 load balancer which sits in front of two WebSEAL 6.1 reverse proxies which then balance requests between…
0
votes
1 answer

Javax ViewExpiredException thrown upon POST

I try to understand why I get a javax ViewExpiredException on my simple webapp - but I don't seem to understand what is causing the view to expire. This is the register.jsf:
Stefan
  • 2,603
  • 2
  • 33
  • 62