【问题标题】:Global error page in ADF/WebCenter application not workingADF/WebCenter 应用程序中的全局错误页面不起作用
【发布时间】:2013-11-26 08:41:58
【问题描述】:

我正在尝试将全局错误页面用于 ADF/WebCenter 应用程序中的任何类型的异常。 在我的 web.xml 我有这个 -

  <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/faces/oracle/webcenter/portalapp/pages/error.jspx</location>
  </error-page>

在我的页面上,我使用托管 bean 来显示一些值:

<af:outputText value="#{mybean.value}" />

这是示例 bean:

public class MyBean {
    private String value = null;
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public MyBean() throws MyAppException {
        calculateValue();
    }
    public void calculateValue() throws MyAppException {
        try { 
            // some business logic
        } catch (Exception e) {
            e.printStackTrace();
            throw new MyAppException();
        }
        setValue(1);
    }    
}

现在,当我故意在托管 bean 的业务逻辑中抛出一些异常时,我希望用户根据我的配置看到错误页面。

但是它不起作用。它仍然在浏览器中显示没有任何内容的相同页面,但在控制台上显示异常堆栈跟踪。

我哪里错了?

【问题讨论】:

    标签: jsp jsf web.xml oracle-adf webcenter


    【解决方案1】:

    我认为您的问题与您用于从 web.xml 引用您的 错误页面 的位置有关。

    所以,如果在你的位置上,我会将我的错误文件放在 Web Content 目录下,并将我的子标签更改为

    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/error.jspx</location>
    

    好吧,我会改用 html 页面

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-16
      • 2011-03-19
      • 1970-01-01
      • 1970-01-01
      • 2020-08-29
      • 2011-12-21
      • 2013-04-29
      • 1970-01-01
      相关资源
      最近更新 更多