ADF adf dc error handling using DCErrorHandlerImpl

Home/ADF/ADF adf dc error handling using DCErrorHandlerImpl

ADF DC Error handling using DCErrorHandlerImpl

This section, I have explained about handling error throws in the ADF application. Default, exception thrown by the application are caught by the binding container, which is routed to the error handler DCErrorHandlerImpl. We will extend this class to create our own custom exception class by overriding the method reportException().

Download Project ADF DC Error handling 

 

Let’s begin to start the ADF DC Error Handling example: 

ADF DC Exceptional Handline – Example started

I have created Employee EO and VO object from HR schema in my ADF Fusion web application. Created a JSF page which holds Employee as editable table and a create button which creates a employee

081516_0529_ADFDCExcept1 ADF adf dc error handling using DCErrorHandlerImpl

Under the viewController, Create a java class that extends DCErrorHandlerImpl. Ensure the super constructor argument is true as shown below

081516_0529_ADFDCExcept2 ADF adf dc error handling using DCErrorHandlerImpl

Right click on the Java class, Go to Source, Select Override Methods

081516_0529_ADFDCExcept3 ADF adf dc error handling using DCErrorHandlerImpl

Select the method reportException and click Ok

081516_0529_ADFDCExcept4 ADF adf dc error handling using DCErrorHandlerImpl

Here I have overrided the reportException method. If the methods receives JBO-25013 error then I set the error message to ‘duplicate employee ID’

Finally, Register the custom exception in the DataBindings.cpx as shown below. The custom exception class should be value of argument ‘ErrorHandlerClass’

081516_0529_ADFDCExcept5 ADF adf dc error handling using DCErrorHandlerImpl

After running the application on the browser, it displays the employee table with create button. If any duplicate employee ID presents during the creation then the reportException() sets the error message and displays it like below.

081516_0529_ADFDCExcept6 ADF adf dc error handling using DCErrorHandlerImpl

pgn ADF adf dc error handling using DCErrorHandlerImpl

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
pgn ADF adf dc error handling using DCErrorHandlerImpl
Like us on Facebook.
Connect!