How do I override all 404 pages without defining default handlers for every resource?
问题 In my Dropwizard project, I'm defining a generic ExceptionMapper<WebApplicationException> : environment.jersey().register(new WebApplicationExceptionMapper()); ...but this doesn't seem to catch any of the 404 errors for unmatched paths. Without defining five defaultHandler() methods for every single resource, how do I catch all 404s so I can return my own error page or some JSON? So, if I had a service with one resrouce, say, /docs , this is the situtation: /myservice/docs/helloworld doesn't