B
Bryce
I'm having a problem using a custom 404 error page with Tomcat. Here's
what I've done:
Got the following method in my servlet:
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
This will generate a 404 error.
My web.xml file has the following declared after my servlet
declaration:
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
I've got an html file 404.html located in the root of my
webapplication. So far so good.
In Mozilla, everything works as expected.
In IE... I get the generic "HTTP 404 Not Found" page.
Through some trial and error, and the wonders of Google, I discovered
that IE has an option "Show friendly HTTP Messages", which by default,
is checked. Unchecking this allows my custom 404 page to display
properly.
The problem is, I can't expect my customers to go in and make changes
to their IE configurations.
I'm thinking of using a Filter which will redirect to a custom page.
Any other ideas that sound better? Maybe I'm configuring Tomcat
incorrectly?
Thanks.
what I've done:
Got the following method in my servlet:
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
This will generate a 404 error.
My web.xml file has the following declared after my servlet
declaration:
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
I've got an html file 404.html located in the root of my
webapplication. So far so good.
In Mozilla, everything works as expected.
In IE... I get the generic "HTTP 404 Not Found" page.
Through some trial and error, and the wonders of Google, I discovered
that IE has an option "Show friendly HTTP Messages", which by default,
is checked. Unchecking this allows my custom 404 page to display
properly.
The problem is, I can't expect my customers to go in and make changes
to their IE configurations.
I'm thinking of using a Filter which will redirect to a custom page.
Any other ideas that sound better? Maybe I'm configuring Tomcat
incorrectly?
Thanks.