Exception Handler is the central point for handling unexpected
Exceptions that are thrown during the Faces lifecycle.
ADF Task Flow provides this facility, using this you can handle all exception that raised in TaskFlow methods.
here i am using ADF bounded TaskFlow with page fragments(.jsff) .
Developers must use this facility to avoid unexpected exception inside task flows.
This is the very simple approach, you have to do nothing more but create a method in Task Flow and mark it as Exception Handler and write your code inside this method, that you want to show when an exception is caught in TaskFlow.
To do this I have implemented this scenario-
- Create a method that throws an Exception and add this method to task flow and on page call this method on button click
- When we click on the button that calls exception() method, JboException is raised inside TaskFlow and look like this- Your page crashed
- Now create a method that will behave as exception handler and add it to TaskFlow and mark as Exception Handler (Symbol in Jdev toolbar for marking)
- Use this sign to mark the method as Exception Handler in Bounded Task Flow
- Now Run your page and click on the button that calls exception() method, your page never crash, as there is a handler
Find Sample application Download Sample ADF Application
An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF