How do you handle errors in the servlets?

How do you handle errors in the servlets?

Postby Kishan » Fri Feb 08, 2013 3:46 pm

How do you handle errors in the servlets?
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am

Re: How do you handle errors in the servlets?

Postby Kishan » Mon Feb 18, 2013 5:08 am

You can declare error page in the web.xml. You can declare error page for status codes and Exceptions.

<error-page>
<error-code>404</error-code>
<location>/Error404.html</location>
</error-page>

<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>/DBError.html</location>
</error-page>
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am


Return to Servlets

Who is online

Users browsing this forum: No registered users and 2 guests

cron