Possibilities for exception handling in PrimeFaces

PrimeFaces provides powerful exception handling for AJAX and non-AJAX requests out of the box. The mapping between error pages and exception types is configured via the error-page ability in web.xml. Exceptions for AJAX requests can also be configured via the special p:ajaxExceptionHandler tag in order for them to be shown on the same page where they occurred. An implicit object, pfExceptionHandler, provides useful information about exception details.

In this recipe, we will give helpful tips about configuration details and demonstrate PrimeFaces' exception handling for AJAX and non-AJAX requests.

Getting ready

In order to be able use the exception handling, a special EL resolver and a factory class ...

Get PrimeFaces Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.