JBoss Community Archive (Read Only)

Portlet Bridge 3.3

Error Handling

To display error pages for specific exceptions in your JSF portlet, you need web.xml content such as:

<error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/faces/error.xhtml</location>
</error-page>
<error-page>
  <exception-type>javax.faces.application.ViewExpiredException</exception-type>
  <location>/faces/error.xhtml</location>
</error-page>

The above error page definitions are appropriate for a JSF portlet that has a FacesServlet mapping such as /faces/. If the FacesServlet mapping was **.jsf then location would be error, error.jsf or error.xhtml.

There is no requirement when using FacesServlet suffix mapping to append an extension, the name of the view is all that is required for the page to be found

Remember to add a link from any error page to the normal flow of your JSF application otherwise the same error page will be constantly displayed.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:28:53 UTC, last content change 2012-09-11 18:11:48 UTC.