Skip to content

Commit 5dce945

Browse files
committed
Document dispatcher-types configuration for secured error pages
Closes gh-19293
1 parent c96455f commit 5dce945

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,12 +2306,20 @@ Note that the default `FilterRegistrationBean` does not include the `ERROR` disp
23062306

23072307

23082308

2309-
[[boot-features-error-handling-websphere]]
2310-
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.
2311-
The request can only be forwarded to the correct error page if the response has not already been committed.
2309+
[[boot-features-error-handling-war-deployment]]
2310+
===== Error handling in a war deployment
2311+
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.
2312+
This is necessary as the Servlet specification does not provide an API for registering error pages.
2313+
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.
2314+
2315+
The error page filter can only forward the request to the correct error page if the response has not already been committed.
23122316
By default, WebSphere Application Server 8.0 and later commits the response upon successful completion of a servlet's service method.
23132317
You should disable this behavior by setting `com.ibm.ws.webcontainer.invokeFlushAfterService` to `false`.
23142318

2319+
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.
2320+
To do so, set the `spring.security.filter.dispatcher-types` property to `async, error, forward, request`.
2321+
2322+
23152323

23162324

23172325
[[boot-features-spring-hateoas]]

0 commit comments

Comments
 (0)