This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes web.xml , Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "web.xml , "error-page" tag" Watch "web.xml , "error-page" tag" New topic

web.xml , "error-page" tag

Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126

I like to do that if my application will receive an error like 400 ( page not found ) then it will not show the error page provided by tomcat , i want that if that type of error comes then my error page will come.

In web.xml i have used-:

But after that it is not forwarding to my page.
Please rectify me.

Tom E. Cole

Joined: Oct 21, 2003
Posts: 9
Is this all there is to your web.xml? If not, you need to make sure that you've got the error-code section defined in the correct place (which depends on the file version you're using, but who would know because you didn't specify it in your web-app tag....)

Other than that, the error-code section you've posted is fine, given that there is a file_not_found.html file in the root directory of your webapp.
Here is my error-code section to my web.xml and it works exactly as expected:

wood burning stoves
subject: web.xml , "error-page" tag
Similar Threads
Tomcat cant recognize "error-page" tag in web.xml
Error Page
replace default reject(denied) page
How to configure to redirect to index.jsp if missing file