jsf - CustomViewHandler does not redirect when session times out during an ajax request -
have legacy richfaces/seam app. session-timeout in web.xml being set 0 (infinite). changed timeout after period (10 minutes). have custom view handler trap viewexpiredexception error when user on page still tried ajax action after web session expired. supposed redirect error page. here setup:
faces-config.xml:
<view-handler>com.acme.beans.customviewhandler</view-handler>
customviewhandler.java:
public uiviewroot restoreview(facescontext facescontext, string viewid) { uiviewroot root = super.restoreview(facescontext, viewid); if (root == null) { root = createview(facescontext, "/error.xhtml"); facescontext.renderresponse(); } return root; }
the handler gets called when timed-out ajax call made on browser client. returned root
super.restoreview()
null, expected. when try create new view pointing our error page, never gets rendered on client, , old, expired page continues displayed. thoughts on doing wrong here? results createview()
calls valid, , not null.
also tried defining exception handler case in pages.xml "javax.faces.application.viewexpiredexception" class. never gets hit.
Comments
Post a Comment