I am using tomcat and I would like, whenever I go to a direction that is not handled by a servlet, do other stuff insead of showing the default error:
type Status report
message /test
description The requested resource is not available.
Where can I handle this¿?
Thank you in advance
Define an error page in web.xml:
<error-page>
<error-code>404</error-code>
<location>/path/to/your/page.html</location>
</error-page>
Update
You can define error pages by their http status (404, 500,...) or by defining the fully qualified exception name (java.lang.Exception, java.io.FileNotFoundException ...). If you are using Servlet 3.x you can even omit the error-code/error-classname part to define a default error page.