This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
How can i hadle errors in tomcat. for example if tomcat could not find a file it simply displays Internal Server Error 500, what i want is it should be directed to my error page, where i can display better message. thanx
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Hello if your application uses the JSP page then do the following things to display the your own message insted of the tomcat's. 1) Define your own page with any name(say ErrorDisplayer.jsp), but in the page directive make the isErrorPage= "True" 2) In this page take the error object and diplay the message with the help of methods of this object. 3) In all other remaining pages (say ErrorClient.jsp) add the page directive at the top and mention this pages relative url in the "errorPage" attribute.
Now when you will access the ErrorClient.jsp from the brower and error comes then control is transfered to the ErrorDisplayer.jsp page. Here in this page you have your own message which will get displayed on the brower insted of tomcat's message. There is one more way also but it is very basic. There is one setting in the internet explorer to display a user friendly message. WHich will wrap ups the system error and display littile bit understandable message. Check the upper one and let us know.
Just like you, struggeling to get the right solutions!<br /> <br />Sun Certified Java Programmer 1.5<br /> <br />Target - SCWCD