Guys I am struggling with the problem of opening my custom error page in Tomcat in Windows Environment. Some of solution I got but no luck. I tried almost all links but its
The same can be implemented programmatically if you use embedded Tomcat for example like this:
Context appContext = ... ErrorPage errorPage = new ErrorPage(); errorPage.setErrorCode(HttpServletResponse.SC_NOT_FOUND); errorPage.setLocation("/my_custom_error_page.html"); appContext.addErrorPage(er);