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

partial-response shown instead of html, after refresh html is shown

I have implemented the answer of this question: Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request When an AJAX request is done and there is a ViewExpiredException it renders my session expired page, which has a link to…
Wesley Egbertsen
  • 720
  • 1
  • 8
  • 25
0
votes
4 answers

ViewExpiredException in JSF

I am using JSF and have javax.faces.STATE_SAVING_METHOD to client in web.xml. What I want to happen is, when session times out and I try to redirect to another page, it must redirect to sessionTimeout.jsf and on click of a button on that page, it…
Prabhat
  • 2,261
  • 7
  • 46
  • 74
0
votes
1 answer

javax.faces.application.ViewExpiredException: View could not be restored

I have a mobile webapp with a single view index.xhtml. I change this view dynamicaly with POST request only. Basically all my ViewScopedBean are SessionScopedBean. I don't know if it is the best solution for mobile webapp but there it is (dynamic…
user4492397
0
votes
0 answers

ViewExpiredException when submitting JSF form to different host

I want to create login functionality for Admin so that admin can login (from Admin-portal) as any user (in User-portal). (These are two different portal running in two different host). In Admin-portal, I have have written
user811602
  • 1,314
  • 2
  • 17
  • 47
0
votes
1 answer

Primefaces PrimeExceptionHandlerELResolver within Spring Boot

i have a web application with Spring Boot 1.2.4(web,security,data-jpa), Primefaces 5.2 , JSF 2.2 (Mojarra 2.2.11) without any xml config file. Only faces-config.xml for spring bean el resolver :
mtbadi39
  • 448
  • 6
  • 18
0
votes
2 answers

JSF too many commandLinks (h:form) lead to ViewExpiredException

I am having a JSF application which creates and presents about 50 reports. These reports are rendered PNGs and under the pictures a table is displayed. This table uses a RichFaces 4 togglePanel with switchType="client". The togglePanel is just for…
0
votes
1 answer

JSF ViewExpired mixed with SecurityFilter

So I have reviewed the answers related to ViewExpiredException and handling this with Ajax requests and I have that handled nicely now. However I have a configuration that doesn't properly get the ViewExpiredException. The application has a…
Dravenj
  • 71
  • 1
  • 10
0
votes
2 answers

ViewExpiredException on Wildfly Openshift

I had hosted sample J2EE webapp on Openshift wildfly 8.1, where I am getting ViewExpiredException. After, providing the error-page and redirecting to Login page on this exception. The Login page is still not able to re-direct to the protected pages…
Bikram
  • 828
  • 8
  • 21
0
votes
1 answer

JSF Session timeout NPE instead ViewExpiredException

JSF(jboss - 2.2.6), AS Wildfly 8.1.0, Deltaspike 1.0.3 After the session has expired, is pressed button (ajax call). The problem is that is thrown a NullPointerExceptiion instead of ViewExpiredException. There is an ExceptionHandlerWrraper. public…
0
votes
0 answers

Error page fails with XML Parsing Error: no element found Location: http://localhost:8080/3c/login/Login.xhtml Line Number 1, Column 1

I would like to handle ViewExpiredException on non-ajax requests (PrimeFaces with ajax="false"). I've configured an error page on that exception in web.xml:
user3696143
  • 301
  • 2
  • 6
  • 23
0
votes
1 answer

Ajax form updates in JSF shows ViewExpiredException

I have a jsf 1.2 application with some links in the index page. This links are oppened by clicks, on new jquery dialogs. Every link open a new page of my app in a distinct dialog, so, the application can open many links in many dialogs in a single…
Pedro Vítor
  • 191
  • 1
  • 6
0
votes
1 answer

Error Page isnt showing with FullAjaxExceptionHandler

I searched almost every question about FullAjaxExceptionHandler here and none of them solved my problem. Well, I have implemented FullAjaxExceptionHandler but it isn't working with ajax requests. If the request isn't Ajax it works OK and redirect to…
0
votes
0 answers

"view has expired" message in Primefaces Demo

In primefaces demo page, if you wait enough time for the session to expire without doing anything and then click an ajax button you get the error message: I'm wondering how this mechanism is implemented. Is it possible that they used…
gesus
  • 471
  • 1
  • 10
  • 24
0
votes
1 answer

Handle ViewExpiredException before handle() method in ExceptionHandlerWrapper is called

I've already searched via google and on stackoverflow, but could not find any similar problem to mine. In my project I'm handling a ViewExpiredException properly and show a custom page to the user that the current session has timed out. This works…
0
votes
0 answers

logout and page expired browser information

I'm quite new in Java EE and JSF. I'm trying to create login system, but I have a problem with back button when user is logged out. To deal with that I created a filter as suggested in in several other topics which I found on stackoverflow, it…
user2759804
  • 45
  • 1
  • 1
  • 5