Use a more reliable mechanism for the DefaultServlet when determining if the current request is for custom error page or not.