-
Notifications
You must be signed in to change notification settings - Fork 40.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitelabel error page doesn't display when deployed to Tomcat server #684
Comments
Otherwise Tomcat will go ahead and uncommit it and handle it again in the ErrorReportValve (duh!) Fixes spring-projectsgh-684
Saw this as well - after the fix the custom page comes back as a 200, should the ErrorPageFilter also set the Response status to 500 (or whatever?). I added |
I assume in a JAR deployment you get a 500 (in which case if you make a change it should go in the filter)? See also #538 (which when fixed will include generic error handling for all >=400 errors), which is down for 1.1 because it's quite a big change. Maybe better to wait till that is finished before changing anything? |
Sounds good, my custom ErrorController takes care of this for now. |
Otherwise Tomcat will go ahead and uncommit it and handle it again in the ErrorReportValve (duh!) Fixes spring-projectsgh-684
I still have the same issue that hoserdude had in 2014. The bad thing about hoserdude's solution is say if the response was something else apart from 500 then you would still return 500. So I want to prevent that happening. ie not much point showing 500 error when the actual response is 404. |
Thanks for your interest. It almost never helps to comment on an issue that was closed as resolved 2 years ago. It's unlikely that you are using the same code as was current then, but if you are just upgrade. Otherwise I would recommend opening a new issue or asking a question on stackoverflow if it's about usage. |
I've got a basic spring boot webapp and I'm trying to create a customised error page for it.
I'm using spring-boot-actuator so I've got its default whitelabel error page and have successfully customised it by creating my own
error.html
page. This is working nicely when running with the embedded Tomcat container - if one of my controllers throws an exception (e.g. DataAccessException) then my custom error page gets displayed. However, when I deploy my app to a Tomcat server I get the default Tomcat error page showing the full stack trace.I've been trying to trace what's going on using the debugger in STS and I've found the
ErrorPageFilter
(which only seems to be present when running on the Tomcat server) is correctly handling the exception and forwarding the request to the error controller. However tracing further I eventually get to theinvoke
method oforg.apache.catalina.valves.ErrorReportValve
which seems to then reset the response.I'm using Spring Boot 1.0.1.RELEASE and Apache Tomcat 7.0.53.
The text was updated successfully, but these errors were encountered: