如何防止向用户显示发生的任何异常?如果发生任何错误,我可以想象将用户重定向到特定页面。
特别是我想防止像这样的 HTTP 状态 500 视图异常:
javax.faces.application.ViewExpiredException: /index.xhtmlNo saved view state could be found for the view identifier: /index.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:132)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)