I need to navigate/render a jsp when a custom exception is thrown from a code block in my app.
for that in web.xml I have configured the error handling
My questions are:
Is this the correct way to invoke a jsp when my code throws an exception?
Do I need a try catch block to handle the thrown RecordNotFoundException, if yes how would I navigate to the jsp from the catch block?
Personally, I never display a JSP page directly. I configure the deployment descriptor to activate a servlet that figures out what should happen, including logging, and forwarding to an appropriate JSP.
And no, you do not catch exceptions that you want the deployment descriptor to handle.