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 must redirect to login.jsf. I have designed sessionTimeout.jsf. Whenever session expires and I try to navigate to a different page, javax.faces.application.ViewExpiredException is thrown. I have set a session variable in target page so that everytime it goes to that page, it first checks the variable but here its throwing exception before going to that page. How to solve this ?
I cannot put <error-page> tag in faces-config.xml and putting it in web.xml wont make any difference
Prabhat
2010-07-21 04:59:12
What JSF implementation are you using, MyFaces, Facelets, Richfaces, etc?
StudiousJoseph
2010-07-21 05:12:59
I am using Richfaces
Prabhat
2010-07-21 05:17:24
@Prabhat: http://stackoverflow.com/questions/3206922/issue-with-jsf-viewexpiredexception-and-multiple-error-page-tag-definitions-in-we
BalusC
2010-07-21 11:26:02
A:
The solution is to add:
<a4j:region>
<script language="javascript">
A4J.AJAX.onExpired = function(loc, expiredMsg){
window.location = "/sessionTimeOut.jsf";
}
</script>
</a4j:region>
Read more in RichFaces guide
Odelya
2010-07-21 08:57:56
A:
add to Web.xml give message in page for reloading...
enter code here
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>viewExpired.xhtml</location>
</error-page>
taher
2010-07-22 13:58:01
Read the other answers and the comments on other answers before unnecessarily posting a duplicate answer.
BalusC
2010-07-22 14:02:38