Merge branch '1.1.x'
This commit is contained in:
commit
97dcd24668
|
|
@ -1348,7 +1348,7 @@ in the ``Production-ready features'' section.
|
|||
|
||||
[[howto-customize-the-whitelabel-error-page]]
|
||||
=== Customize the ``whitelabel'' error page
|
||||
The Actuator installs a ``whitelabel'' error page that you will see in browser client if
|
||||
Spring Boot installs a ``whitelabel'' error page that you will see in browser client if
|
||||
you encounter a server error (machine clients consuming JSON and other media types should
|
||||
see a sensible response with the right error code). To switch it off you can set
|
||||
`error.whitelabel.enabled=false`, but normally in addition or alternatively to that you
|
||||
|
|
@ -1361,6 +1361,8 @@ of the default configuration you should find a `BeanNameViewResolver` in your
|
|||
`ApplicationContext` so a `@Bean` with id `error` would be a simple way of doing that.
|
||||
Look at {sc-spring-boot-autoconfigure}/web/ErrorMvcAutoConfiguration.{sc-ext}[`ErrorMvcAutoConfiguration`] for more options.
|
||||
|
||||
See also the section on <<boot-features-error-handling, Error Handling>> for details of
|
||||
how to register handlers in the servlet container.
|
||||
|
||||
|
||||
[[howto-security]]
|
||||
|
|
|
|||
|
|
@ -1001,6 +1001,24 @@ You can also use regular Spring MVC features like http://docs.spring.io/spring/d
|
|||
methods] and http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc-ann-controller-advice[`@ControllerAdvice`].
|
||||
The `ErrorController` will then pick up any unhandled exceptions.
|
||||
|
||||
N.B. if you register an `ErrorPage` with a path that will end up being handled by a `Filter` (e.g. as is common with some non-Spring web frameworks,
|
||||
like Jersey and Wicket), then the `Filter` has to be explicitly registered as an `ERROR` dispatcher, e.g.
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
@Bean
|
||||
public FilterRegistrationBean myFilter() {
|
||||
|
||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||
registration.setFilter(new MyFilter());
|
||||
...
|
||||
registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
|
||||
return registration;
|
||||
|
||||
}
|
||||
----
|
||||
|
||||
(the default `FilterRegistrationBean` does not include the `ERROR` dispatcher type).
|
||||
|
||||
|
||||
[[boot-features-embedded-container]]
|
||||
|
|
|
|||
Loading…
Reference in New Issue