From the course: Learning PrimeFaces

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Ajax exception handling

Ajax exception handling

From the course: Learning PrimeFaces

Start my 1-month free trial

Ajax exception handling

- [Instructor] Now let's get into my personal favorite AJAX component, the AJAX exception handler. AJAX exception handling as been a sore point for JSF enthusiasts that grew up on the standard JSF diet. With standard JSF if an exception happens while processing an AJAX request or if the browser session times out, you have to guess your way around it or hack your all exception handler together. The dreaded view expired exception and other AJAX induced errors were notoriously difficult to handle and communicate to the user. No more, with the P AJAX exception handler we can gracefully notify the user of errors that occur in the AJAX live fix. Let's use this method forced exception to simulate an exception. We'll throw an illegal argument exception here. Throw new illegal argument exception with a message something broke. Let's end that, we'll save our work. Then let's go to the faces page and bind a command button to the forced exception method. We'll use this marker, let's remove that…

Contents