

Public class MyJsfAjaxTimeoutPhaseListener implements PhaseListener It re-creates the response so that the Ajax request could be redirect after timeout. This PhaseListener is the most important part of the solution. Public void setTimeoutUrl(String timeoutUrl) Second, create a PhaseListener to handle the redirect of Ajax request.

You may not need this class if you do not want the timeout URL to be configurable. The main purpose of this POJO is just to allow you to configure the redirect url after session timeout in faces-config.xml. First, create a simple session scoped JSF managed bean called ‘MyJsfAjaxTimeoutSetting’.

For those application that is not using Spring Security framework, how can they handle such problem? I just modified the solution proposed by Oleg Varaksin a bit as my reference. Yet, some applications may just using simple mechanism to stored their authentication and authorization information in session. Spring Security 3 and ICEfaces 3 Tutorial The followings are two of possible solutions involve the use of Spring security framework:Ģ. Many people proposed solution for this issue. User will remain on the same page and does not aware that the session is expired. However, if your request is AJAX, the response could not be treated properly on the client-side. For example, if you are using J2EE Form-based authentication, a normal request should be redirected to the login page after session timeout. When we develop JSF application with AJAX behaviour, we may experience the problem in handling timeout scenario of Ajax request. Session Timeout Handling on JSF AJAX request
