I am working on a web service. Sometimes during my testing exceptions are thrown and displayed on the browser page. I am not sure why even the code that “could” throw an exception is within the try-catch block, the exception is still printed in the browser.
I certainly can create exception handler with Spring or exception mapper (with JBoss) but still there are exceptions that could be thrown that are not mapped, and I don’t want this to be printed on the browser.
How can I fix this?
in your web.xml you can define error pages like this
and so on… you can have for any other error code especially error 500 witch i think is more suitable for your case