• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bad addresses URL throwing up ugly HTTP 500 with stack trace

 
Samrat Roy
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The application I am currently working throws up ugly stack traces if the url entered is wrong ; For example :

if you enter http://blahBlah.zapdata.com the tomcat will display an UGLY HTTP status 500 with a Catalina stack trace :


This is not a valid address.. But if you enter http://blahBlah.google.com , the website displays a clean error message like .


How can I configure tomcat to display clean error messages and not a stack trace?

I have tried the error page tag <error-page><error-code> in the web.xml of the application , that works fine if there is a genuine problem with the application but not when the initial url entered is wrong.

Please HELP !!!
 
Charles 'King
Ranch Hand
Posts: 56
Eclipse IDE Postgres Database Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can configure your app to catch all exceptions by using the correct syntax in the DD. Additionally, if you're using JSP's, you can use the error page attribute of page directive. Review sun's example: http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/packaging_deployment/descriptors/index.html

If you still have questions, post your DD error page section.

As an aside, is your question intrinsic to your app or are you attempting to handle all errors returned by the container regardless of app?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic