To prevent users from seeing error pages and ensure that they have a pleasant experience in your application you can add the customErrors element to your Web.config file. Handling error codes and exceptions by the web.xml, you can configure error-page elements that act upon some error-code or exception-type.