If I have an exception in my business layer (e.g. a SQL exception in my JDBC connection bean), how can I propagate it with a custom message to a global error.jsp
pa
The general way to display error message to the user in JSF is to use FacesMessage:
On Java side:
...
if (errorOccurred) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("An error occurred blabla..."));
}
and in the JSF (JSP or XHTML) page, simply use the
component in your page in order to display the error.