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
2
votes
1 answer

Override of logException method of OmniFaces FullAjaxExceptionHandler does not get invoked

I am using OmniFaces (1.7) FullAjaxExceptionHandler to handle (ViewExpired)Exception's during ajax requests. I don't want to the FullAjaxExceptionHandler to log the exception with level SEVERE as the default implementation does. So I did override…
jimmybondy
  • 2,092
  • 3
  • 21
  • 33
2
votes
1 answer

JSFViewExpiredException handling from web.xml is not working

I am learning j2ee and started with a simple login and logout application. I would like to gracefully handle javax.faces.application.ViewExpiredException upon session timeout. Looking at several posts, I tried to handle it via web.xml using the…
syed
  • 21
  • 3
2
votes
0 answers

JSF session bean target unreachable in process

I have a JSF 1.2 web application that has been in use for several years. Over the last couple days I've seen many 'Target unreachable' errors while users are processing. The underlying objects on my session scoped beans seem to be null. This…
Eric
  • 21
  • 2
2
votes
0 answers

Unable to login via a login page which is configured as error page of ViewExpiredException

I used omnifaces to handle Redirect problem After Session Expired at PrimeFaces and it works very well. The problem is when I try to relogin after session timeout occurs and it directs me to login page, I come across with the following error. After…
Tonyukuk
  • 5,745
  • 7
  • 35
  • 63
2
votes
1 answer

Difference between Session Expired and ViewExpiredException

I've come across many solutions for the two 'huge' problems Session Expired ViewExpiredException My Question: What is the difference between them? I'm using WAS and I observed Restarting the EAR in the console does not cause the session to…
rottweiler
  • 1,201
  • 1
  • 12
  • 23
2
votes
1 answer

Handling ViewExpiredException (JSF 2.1, Seam2 , Primefaces 3.4.1, Omnifaces 1.3)

I am having terrible problems trying to handle ViewexpiredException correctly using the frameworks JSF 2.1, Seam 2.3, Primefaces 3.4.1, Omnifaces 1.3. Here you can see a full explanation of my problem I post in primefaces…
2
votes
2 answers

Handle ViewExireException/ajax and display a Primefaces dialog

I don't redirect or forward my user to another page. So when the my SessionExpiredExceptionHandler (extends ExceptionHandlerWrapper) handles the ViewExireException. I want the user to stay on the same page and display a PrimeFaces Dialog. For…
Chris
  • 712
  • 3
  • 16
  • 39
2
votes
1 answer

Object doesn't support this property or method with primefaces omnifaces timeout combination

Setup: JSF, PrimeFaces 3.2, Omnifaces 1.1, JBoss AS 7.1.1, Final, Mojarra 2.1.7 I have a simple page (listed below) and I have set up omnifaces to deal with ViewExpiredExceptions for ajax calls. When the listed below page expires and I click on a…
2
votes
1 answer

Handling ViewExpiredException on login page using a custom ViewHandler

In my web app, when the session expires and a user initiates a request (full page or AJAX), the user is redirected to the login page with a message that the session expired. The problem is, when the login page is left open long enough for the…
Steve
  • 8,066
  • 11
  • 70
  • 112
1
vote
0 answers

jsf viewexpiredexception faces-redirect not working

I have a filter that if the session has expired and the method is POST, then adds the faces-redirect param to the url and makes the browswer not to cache the page, in order to avoid the viewExpiredException, but doesn't work, I still get that…
choquero70
  • 4,470
  • 2
  • 28
  • 48
1
vote
1 answer

JSF wrong redirection when catching ViewExpiredException

So I have a ViewExpiredException Handler and works fine. Now, when I launch the web-app my URL looks like www.myApp.com/TestFaces/ and this presents the first page which is the login page. If for any reason I leave the page at login, and the View…
BRabbit27
  • 6,333
  • 17
  • 90
  • 161
1
vote
1 answer

ERROR: MAC did not verify, only when accessing using domain name

I have a single domain name pointing to a single server running a JoinFaces + PrimeFaces project. When I click on a p:commandButton in a form on the server through its IP address, then everything works just fine. But when I do the same through the…
mossaab
  • 1,812
  • 4
  • 23
  • 44
1
vote
2 answers

JSF 2 Session Beans Problems

I have a JSF 2.1 (MyFaces) app running using several Session Beans (All the beans are session beans). The timeout is defined in web.xml as such: 3600 Which translates to 1…
Ben
  • 10,020
  • 21
  • 94
  • 157
1
vote
2 answers

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

i've created this webpage using jsf,prettyfaces and hibernate i looked around and most people says that this error is because of cache most of them found this error after login,logout and try to login back but i found this error when i log in,and…
tokwan
  • 11
  • 1
  • 2
1
vote
0 answers

Primefaces View Expired Exception at Dialog Showcase

In our Application, we get a View Expired Exception when returning from a dialog with many (~40) input fields. I tested it and I get the same exception at the primefaces showcase. Steps to reproduce: go to…
JavaMan
  • 1,142
  • 12
  • 22