【问题标题】:Primefaces Error pagePrimefaces 错误页面
【发布时间】:2016-06-06 09:34:36
【问题描述】:

我想开发一个代码,可以将我重定向到 错误页面,而不会在页面上显示错误消息。示例:当我的代码中存在错误时,而不是显示这些内容

Message: viewId:/ui/misc/exceptionHandler.xhtml - A ViewExpiredException! 
StackTrace: javax.faces.application.ViewExpiredException: viewId:/ui/misc/exceptionHandler.xhtml - A ViewExpiredException! at
org.primefaces.showcase.view.misc.ExceptionHandlerView.throwViewExpiredException(ExceptionHandlerView.java:39
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

我宁愿得到一个错误页面说 PAGE NOT FOUND

请提供帮助。

【问题讨论】:

    标签: java primefaces xhtml glassfish-4.1


    【解决方案1】:

    您应该为此目的配置您的 web.xml 并将所有错误页面放在那里例如:

    <error-page>
        <error-code>404</error-code>
        <location>/location-of-your-errors-pages/error404.xhtml</location>
    </error-page>
    

    如果你使用的是 netbeans 那就很简单了,直接去

    【讨论】:

      猜你喜欢
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多