View / page.jsf failed to restore

I have a problem that I cannot solve. When I refresh a open JSF page after a page is idle, for example, 10 minutes, I get this error message:

serverError: class javax.faces.application.ViewExpiredException viewId:/page.jsf - View /page.jsf could not be restored. 

How can I increase JSF browsing time?

+7
source share
1 answer

You can set the session timeout parameter to 45 minutes in web.xml, like this

 <session-config> <session-timeout>45</session-timeout> </session-config> 

you can also easily handle this exception on a separate page by adding the following code to your web.xml

 <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/exception/sessionexpired.xhtml</location> </error-page> 
+19
source

All Articles