Commit 5dce945e authored by Andy Wilkinson's avatar Andy Wilkinson

Document dispatcher-types configuration for secured error pages

Closes gh-19293
parent c96455f7
...@@ -2306,12 +2306,20 @@ Note that the default `FilterRegistrationBean` does not include the `ERROR` disp ...@@ -2306,12 +2306,20 @@ Note that the default `FilterRegistrationBean` does not include the `ERROR` disp
[[boot-features-error-handling-websphere]] [[boot-features-error-handling-war-deployment]]
CAUTION:When deployed to a servlet container, Spring Boot uses its error page filter to forward a request with an error status to the appropriate error page. ===== Error handling in a war deployment
The request can only be forwarded to the correct error page if the response has not already been committed. When deployed to a servlet container, Spring Boot uses its error page filter to forward a request with an error status to the appropriate error page.
This is necessary as the Servlet specification does not provide an API for registering error pages.
Depending on the container that you are deploying your war file to and the technologies that your application uses, some additional configuration may be required.
The error page filter can only forward the request to the correct error page if the response has not already been committed.
By default, WebSphere Application Server 8.0 and later commits the response upon successful completion of a servlet's service method. By default, WebSphere Application Server 8.0 and later commits the response upon successful completion of a servlet's service method.
You should disable this behavior by setting `com.ibm.ws.webcontainer.invokeFlushAfterService` to `false`. You should disable this behavior by setting `com.ibm.ws.webcontainer.invokeFlushAfterService` to `false`.
If you are using Spring Security and want to access the principal in an error page, you must configure Spring Security's filter to be invoked on error dispatches.
To do so, set the `spring.security.filter.dispatcher-types` property to `async, error, forward, request`.
[[boot-features-spring-hateoas]] [[boot-features-spring-hateoas]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment