问题
I have found on several locations how to use Spring boot to make a custom error page but I cannot seem to figure out how to make it show a stack trace.
This is what I have:
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return new EmbeddedServletContainerCustomizer() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/WEB-INF/jsp/app/404.jsp");
ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/WEB-INF/jsp/app/500.jsp");
container.addErrorPages(error404Page, error500Page);
}
};
}
Any ideas how I could figure this out or how to get the stack trace to begin with?
回答1:
You can't right now using what Spring Boot offers out-of-the-box. There is a pull request that I'd like to merge in 1.3 which should give you enough context to figure out the missing bits.
来源:https://stackoverflow.com/questions/32211434/spring-boot-custom-error-page-stack-trace