[Logo]
Forums Register Login
Catching an Exception inside a Servlet
Hi ,


This is the scenario . I have a servlet calling a DAO Layer which is implemented in Hibernate . I want to show an appropiate page when an exception occurs for which i had configured exceptions and locations inside web.xml file.

If an User Defined Exception (say RecordNotFoundException) is thrown inside the DAO Layer .

Is it sufficient to just use throw new RecordNotFoundException inside the DAO Layer ? or is it necessary the servlet should also catch this exception ??



Please help.
 

Ravi Pavan wrote:
Is it sufficient to just use throw new RecordNotFoundException inside the DAO Layer ?


Yes

Ravi Pavan wrote:
is it necessary the servlet should also catch this exception ??



Not Required

Hope this helps
Yes it helped .Thanks a lot.

 

Ravi Pavan wrote:Yes it helped .Thanks a lot.



You Are Welcome

This thread has been viewed 983 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 18, 2018 12:12:15.