• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom error 404 page  RSS feed

 
Tejpal Singh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have my JBoss-2.2.1 configured with Tomcat-3.2.1.
I want to redirect the flow of the application on "Page not found" or "error 404" to a customized page say "error404.html".
I have tried all that i could find on various forums but still cant get it working.
Following is what i am using in my tomcat web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
...
...
<error-page>
<error-code>404</error-code>
<location>/error404.html</location>
</error-page>
</web-app>
The default context is ROOT.
i.e. the xml file is located under the path D:\JBoss-2.2.1_Tomcat-3.2.1\tomcat\webapps\ROOT\WEB-INF
The html file is located under the path D:\JBoss-2.2.1_Tomcat-3.2.1\tomcat\webapps\ROOT\
Please help me on my above issue.
Cheers!
- Tejpal
 
zhangd01
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The web.xml you are using is for the default context. If you need to set the 404 error page for your own application(context), you need to modify the web.xml file under that context directory, not the default.
Good luck!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!