The development stack trace is probably coming from your JSF implementation. The code for disabling it will be specific to the impementation. For MyFaces in Servlets, use this init parameter in your web.xml
:
<context-param>
<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
<param-value>false</param-value>
</context-param>
If you're using the Sun implementation (Mojarra), there may be some com.sun.faces...
keyed parameter.
You may also want to check the value of Facelets init parameter facelets.DEVELOPMENT
(make sure you haven't set it to true
).
To specify an error page, you can use the usual container mechanisms. For Servlets, this would be by specifying a error pages in web.xml
, keyed to either exception types or error codes. To catch all throwables...
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorPage.faces</location>
</error-page>
You might find additional vendor-specific support for error handling in the JSF implementations - you'd have to check their documentation.