If you are talking about the servlet specification error-page, up to version 2.5, inside the web-app tag (the main tag of the web.xml file that is inside WEB-INF) is the possibility that you have one or more error-page tags, eg:
<!-- não encontrado -->
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
<!-- erro interno -->
<error-page>
<error-code>500</error-code>
<location>/500.jsp</location>
</error-page>
If it is from Servlet 3.0, you can generalize by doing:
<!-- qualquer erro -->
<error-page>
<location>/minhaPaginaDeErro.jsp</location>
</error-page>
Taking advantage of the fact that we are talking about error pages, you can have access to special objects (you can even see the stacktrace in case of a 500 error for example). For more details, see this link .