Mapping in web.xml
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
Error handling with ErrorHandler servlet
RequestDispatcher view = request.getRequestDispatcher("error.jsp");
view.forward(request, response);
Styling the jsp error page
body {
background-image: url(err-images/fon.png);
}
How to display a background image on the error page when the URL pattern is incorrect, such as
http://localhost:8080/WEBSearchPrime_JB/wrong/register.xhtml
One solution could be to upload images to an external hosting site and use absolute URLs :)