Error Page Location
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us error page location servlet Learn more about Stack Overflow the company Business Learn more about hiring developers
Web Xml Error Page Location
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Nginx Default Error Page Location
Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to specify the default error page in
Tomcat Default Error Page Location
web.xml? up vote 85 down vote favorite 37 I am using element in web.xml to specify the friendly error page when user encounters a certain error such as error with code of 404: 404 /Error404.html However, I want that if the user does not meet any error code specified in , he or she should see a default error page. How can I do web.xml error-page example that using the element in the web.xml? java servlets tomcat6 web.xml custom-error-pages share|improve this question edited Sep 18 '14 at 14:42 Jayy 1,59521525 asked Aug 15 '11 at 14:34 ipkiss 4,089195895 2 What servletcontainer are you using/targeting and what servlet version is your web.xml declared to? There's only since Servlet 3.0 an easy way. –BalusC Aug 15 '11 at 14:44 I am using Tomcat 6, servlet 2.5 –ipkiss Aug 15 '11 at 14:49 add a comment| 2 Answers 2 active oldest votes up vote 161 down vote accepted On Servlet 3.0 or newer you could just specify /general-error.html But as you're still on Servlet 2.5, there's no other way than specifying every common HTTP error individually. You need to figure which HTTP errors the enduser could possibly face. On a barebones webapp with for example the usage of HTTP authentication, having a disabled directory listing, using custom servlets and code which can possibly throw unhandled exceptions or does not have all methods implemented, then you'd like to set it for HTTP errors 401, 403, 500 and 503 respectively. 401 /general-error.html ErrorHandler ErrorHandler ErrorHandler /ErrorHandler 404 /ErrorHandler 403 /ErrorHandler javax.servlet.ServletException /ErrorHandler java.io.IOException /ErrorHandler If you want to have a generic Error Handler for all the exceptions then you should define following error-page instead of defining separate error-page elements for every exception: java.lang.Throwable /ErrorHandler Following are the points to be noted about above web.