Commit e07889b0 authored by Phillip Webb's avatar Phillip Webb

Document that Filter beans are eagerly initialized

Closes gh-17814
parent 7e60f4b3
......@@ -2663,6 +2663,9 @@ It is usually safe to leave Filter beans unordered.
If a specific order is required, you should avoid configuring a Filter that reads the request body at `Ordered.HIGHEST_PRECEDENCE`, since it might go against the character encoding configuration of your application.
If a Servlet filter wraps the request, it should be configured with an order that is less than or equal to `OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER`.
WARNING: Take care when registering `Filter` beans since they are initialized very early in the application lifectyle.
If you need to register a `Filter` that interacts with other beans, consider using a {spring-boot-module-api}/web/servlet/DelegatingFilterProxyRegistrationBean.html[`DelegatingFilterProxyRegistrationBean`] instead.
[[boot-features-embedded-container-context-initializer]]
......
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