I want to provide a custom 404 error page in my Spring 3.1 web application, but I cannot deactivate Jetty 8\'s default 404 error page.
Jetty 8, out of the box, provi
The solution to my problem was to add a custom org.eclipse.jetty.server.handler.ErrorHandler
.
If a user doesn't explicitly specify some ErrorHandler
, the Jetty server instance seems to register a default ErrorHandler
.
As outlined on http://www.eclipse.org/jetty/documentation/current/custom-error-pages.html, to register a custom ErrorHandler
, you can follow the following steps.
org.eclipse.jetty.server.handler.ErrorHandler
subclass, e.g. com.example.CustomErrorHandler
.CustomErrorHandler
in a jar
file and then copying that jar
file into the ${jetty.base}/lib/ext
directory.ErrorHandler
registered as a bean:file jetty.xml
: