Skip to content

Instantly share code, notes, and snippets.

@punkmonday
Created February 13, 2017 08:14
Show Gist options
  • Save punkmonday/0ca36683495269501559a5c8dfc52512 to your computer and use it in GitHub Desktop.
Save punkmonday/0ca36683495269501559a5c8dfc52512 to your computer and use it in GitHub Desktop.
MyFaceletViewHandler.java
public class MyFaceletViewHandler extends FaceletViewHandler {
public MyFaceletViewHandler(ViewHandler parent) {
super(parent);
}
@Override
public UIViewRoot restoreView(FacesContext facesContext, String viewId) {
UIViewRoot root = super.restoreView(facesContext, viewId);
// do not allow ViewExpiredException
if (root == null) {
root = createView(facesContext, "/viewExpired.xhtml");
facesContext.renderResponse();
}
return root;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment