You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Boot installs a '`whitelabel`' error page that you see in a 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).
24
-
25
-
NOTE: Set `server.error.whitelabel.enabled=false` to switch the default error page off.
26
-
Doing so restores the default of the servlet container that you are using.
27
-
Note that Spring Boot still tries to resolve the error view, so you should probably add your own error page rather than disabling it completely.
28
-
29
-
Overriding the error page with your own depends on the templating technology that you use.
30
-
For example, if you use Thymeleaf, you can add an `error.html` template.
31
-
If you use FreeMarker, you can add an `error.ftlh` template.
32
-
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
33
-
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be one way of doing that.
34
-
See {code-spring-boot-autoconfigure-src}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
35
-
36
-
See also the section on xref:reference:web/servlet.adoc#web.servlet.spring-mvc.error-handling[] for details of how to register handlers in the servlet container.
Spring Boot installs a '`whitelabel`' error page that you see in a 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).
251
+
252
+
NOTE: Set `server.error.whitelabel.enabled=false` to switch the default error page off.
253
+
Doing so restores the default of the servlet container that you are using.
254
+
Note that Spring Boot still tries to resolve the error view, so you should probably add your own error page rather than disabling it completely.
255
+
256
+
Overriding the error page with your own depends on the templating technology that you use.
257
+
For example, if you use Thymeleaf, you can add an `error.html` template.
258
+
If you use FreeMarker, you can add an `error.ftlh` template.
259
+
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
260
+
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be one way of doing that.
261
+
See {code-spring-boot-autoconfigure-src}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
262
+
263
+
See also the section on xref:reference:web/servlet.adoc#web.servlet.spring-mvc.error-handling[] for details of how to register handlers in the servlet container.
0 commit comments