| Author |
how to trap 404 error
|
Vijay Kumar
Ranch Hand
Joined: Jul 24, 2003
Posts: 260
|
|
hi all I am developing an application using tomcat+jsp. i want to display ap proper error message if any resource is not found on the server.. my url is http://localhost/myapp/file.jsp if file.jsp is not not found then it should display a perticular user defined message.It should not display the server define message Like HTTP Status 404 - /file.jsp ------------------------------------------------------------------------- type Status report message /file.jsp description The requested resource (/file.jsp) is not available. ------------------------------------------------------------------------ Apache Tomcat/4.1.29 thankx
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Create an error page mapping for 404 errors in your web.xml file
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Vijay Kumar
Ranch Hand
Joined: Jul 24, 2003
Posts: 260
|
|
hi ben thanks I did the same for my application it working fine but if write url like http://localhost/file.jsp then it is displaying the same default error page I want to make it my self thanks
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
That's because it's looking for file.jsp in the default context. Add the same error-page mapping and file to the app in TOMCAT_HOME/webapps/ROOT.
|
 |
Vijay Kumar
Ranch Hand
Joined: Jul 24, 2003
Posts: 260
|
|
Hi Ben thanks a lot really u help me lot...
|
 |
 |
|
|
subject: how to trap 404 error
|
|
|