Is there a way to have a custom error page while maintaining the HTTP error code (not capturing the error with an error page that itself has a 200 code)? Can that have to be done using the in web.xml or can I do that directly in the JSP?
If I send an HTTP error code using response.sendError then no other text appears on the page. I am able to get text on the page using out.println() but it doesn’t seem to be able to print out html, just basic text.
You should use response.setStatus(int statusCode) to set the status to 404 while still allowing you to send your custom error page.