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

Why occur ViewExpiredException/IllegalArgumentException in jsf-spring webapp on login page?

I've a webapp with frameowrks JSF (Primefaces), Spring, Spring Security, PrettyFaces and Mybatis. Webapp have a login page as index page. When webapp is deployed for first time and I try log on occur IllegalArgumentException or ViewExpiredException…
0
votes
1 answer

NullPointerException while resolving navigation case on a ViewExpiredException

I've created a custom exception handler which should navigate to a specific view on a ViewExpiredException. ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); Throwable t = context.getException(); if (t…
shreekanth
  • 459
  • 2
  • 12
  • 27
0
votes
1 answer

Websphere Portal JSF 2 session timeout page with button when clicked causes View Expired Exception

I'm using Websphere Portal 8 with Primefaces 3.5. The requirement is that when the session times out, the user is redirected to a session timeout page which has a button on it that when clicked takes the user back to the login page. The login page…
zargarf
  • 633
  • 6
  • 18
0
votes
1 answer

How to handle ViewExpiredException by showing JavaScript alert?

I've read the question Handle ViewExireException/ajax and display a Primefaces dialog and the answer from BalusC. I'd want to handle the ViewExpiredException by showing the alert with information to refresh the page. I've taken the suggestion from…
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
0
votes
0 answers

Glassfish Server Session invalidate

I have deployed my web application on Glashfish 3.2.1. I have set the session timeout to be 30 minutes in the web.xml. My application has a login page and once this user is authenticated(password checked) the login proceeds loading the webpage.…
0
votes
0 answers

JSF2.0 NPE on RenderResponsePhase when session is expired (viewRoot is null)

My application uses JSF 2.0.6 and RichFaces 4.1.0. I implemented an ExceptionHandler which normally displays all exception in popup windows, and is working fine. But something goes wrong when I disable partial state saving with this context…
kev
  • 95
  • 1
  • 2
  • 8
0
votes
0 answers

Testing a JSF Application with JMeter

I am a trying to execute a test script for a JSF application. I have followed the steps in from the below link: wiki.apache.org/myfaces/PerformanceTestingWithJMeter My script is navigating through 5 pages. The issue is i am able load all the 4 pages…
Hariharbalaji
  • 2,498
  • 8
  • 36
  • 51
0
votes
1 answer

rich:fileUpload ViewExpiredException

Im using rich:fileUpload:
vctlzac
  • 837
  • 2
  • 16
  • 38
0
votes
1 answer

define error pages location jsf 2

I am trying to redirect my user to the login page when the session expires. I followed the instructions on this link How to handle session expiration and ViewExpiredException in JSF 2? and it works, except for the fact that it redirects me to a non…
Kelly Goedert
  • 1,027
  • 2
  • 11
  • 37
-3
votes
1 answer

ViewExpiredException not thrown on ajax request if JSF page is protected by j_security_check - Follow up

ViewExpiredException not thrown on ajax request if JSF page is protected by j_security_check provides the solution when the login page is the JSF page. But what if the login page is a JSP page? I have a jsp login page:
1 2 3 4 5 6 7
8