I am trying to use global error page for any kind of exception in a ADF/WebCenter application. In my web.xml I have this -
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/faces/oracle/webcenter/portalapp/pages/error.jspx</location>
</error-page>
On my page, I am using a managed bean to display some value:
<af:outputText value="#{mybean.value}" />
Here is example 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);
}
}
Now here when I intentionally throw some exception in my business logic in managed bean, I was expecting user to see error page as per my configuration.
However it's not working. It still shows same page without any content in browser but exception stack trace on console.
Where I am wrong?