How do you override the default error pages (suffixed with "Powered by Jetty") when running Jetty as an embedded server?
i.e.
Server server = new Server(8080);
server.setHandler(new Handler());
/* configure custom error pages? */
server.start();
server.join();
This should solve your problem.
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/*");
Server jettyServer = new Server(8080);
jettyServer.setHandler(context);
ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler();
errorHandler.addErrorPage(404, "/missing.html");
context.setErrorHandler(errorHandler);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With