错误页面因XML分析错误而失败:找不到元素位置:http:// localhost:8080 / 3c / login / Login.xhtml第1行,第1列

时间:2014-07-23 06:51:09

标签: jsf exception-handling facelets viewexpiredexception

我想对非ajax请求(PrimeFaces ViewExpiredException)处理ajax="false"。我在web.xml

中为该例外配置了错误页面
<error-page>
    <exception-type>javax.faces.application.ViewExpiredException</exception-type>
    <location>/errorpages/expired.xhtml</location>
</error-page>

当视图过期时发生异常,将记录以下内容:

  

SEVERE:servlet [Faces Servlet]的Servlet.service()与上下文有关   path [/ 3c]抛出异常[viewId:/login/Login.xhtml - 查看   /login/Login.xhtml无法恢复。]有根本原因   javax.faces.application.ViewExpiredException:   viewId:/login/Login.xhtml - 查看/login/Login.xhtml不可能   恢复。在   com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205)     在com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)at   com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)     在   com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)     在javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     在   org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     在   org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     在com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     在   org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     在   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)     在   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)     在   org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)     在   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)     在   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)     在   org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)     在   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)     在   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)     在   org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)     在   org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607)     在   org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:314)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在   org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)     在java.lang.Thread.run(Thread.java:722)

但是,浏览器会显示一个带有消息的黄页:

,而不是错误页面内容
  

XML解析错误:找不到元素
  地点:http://example.com:8080/3c/login/Login.xhtml第1行,第1列:

为什么/errorpages/expired.xhtml的内容未显示?

0 个答案:

没有答案