1
0
mirror of synced 2026-08-05 09:47:05 +00:00

Merge branch '6.5.x'

Closes gh-17163
This commit is contained in:
Rob Winch
2025-05-22 15:01:27 -05:00
3 changed files with 80 additions and 24 deletions
@@ -29,30 +29,7 @@ In this case, the `Filter` typically writes the `HttpServletResponse`.
The power of the `Filter` comes from the `FilterChain` that is passed into it.
.`FilterChain` Usage Example
[tabs]
======
Java::
+
[source,java,role="primary"]
----
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
// do something before the rest of the application
chain.doFilter(request, response); // invoke the rest of the application
// do something after the rest of the application
}
----
Kotlin::
+
[source,kotlin,role="secondary"]
----
fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) {
// do something before the rest of the application
chain.doFilter(request, response) // invoke the rest of the application
// do something after the rest of the application
}
----
======
include-code::./FilterChainUsage[tag=dofilter,indent=0]
Since a `Filter` impacts only downstream `Filter` instances and the `Servlet`, the order in which each `Filter` is invoked is extremely important.