I am working on dropwizard-Java project.I am trying to create my own custom page for 404 error. I have the coded till,a blank page showing a given string.
@Path("/{default: .*}")
public class DefaultErrorPage implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
throws IOException {
if (responseContext.getStatus() == 404) {
responseContext.setEntity("This page is not found");
}
}
But I needed to return a html page when it shows 404 error.If anyone knows,please help me to solve.