Book Image

Learning PrimeFaces Extensions Development

By : Sudheer Jonna
Book Image

Learning PrimeFaces Extensions Development

By: Sudheer Jonna

Overview of this book

Table of Contents (14 chapters)
Learning PrimeFaces Extensions Development
About the Author
About the Reviewers

The Ajax error handling component and its usage

If a partial Ajax throws an error, PrimeFaces web applications won't respond to the error. The developer won't be aware where the root cause for this issue is and how to overcome the issue to proceed further. The Ajax errors occur frequently when the action listener throws an exception during the DB save operation or when the session expires the use cases. After the session expires, the user action has no effect on the web page.

To overcome these use cases, the Extensions library introduced pe:ajaxErrorHandler to display the messages in case of an Ajax error detection. You can customize the messages based on the type of error as well.

This component supports both the simple and extended modes. You can activate the extended mode by setting exception-handler-factory in the faces-config.xml file. The extended mode resolves the session expired issues when you set STATE-SAVING_METHOD=server and PARTIAL_STATE_SAVING=false.

Configure exception-handler...