@@ -29960,7 +29960,8 @@ To use Servlet 3 async request processing, you need to update `web.xml` to versi
2996029960----
2996129961 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
2996229962 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29963- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
29963+ http://java.sun.com/xml/ns/javaee
29964+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
2996429965 version="3.0">
2996529966
2996629967 ...
@@ -29975,6 +29976,43 @@ ASYNC dispatcher type. Note that it is safe to enable the ASYNC dispatcher type
2997529976filters provided with the Spring Framework since they will not get involved in async
2997629977dispatches unless needed.
2997729978
29979+ [WARNING]
29980+ ====
29981+ Note that for some Filters it is absolutely critical to ensure they are mapped to
29982+ be invoked during asynchronous dispatches. For example if a filter such as the
29983+ `OpenEntityManagerInViewFilter` is responsible for releasing database connection
29984+ resources and must be invoked at the end of an async request.
29985+
29986+ Below is an example of a propertly configured filter:
29987+ ====
29988+
29989+ [source,xml,indent=0]
29990+ [subs="verbatim,quotes"]
29991+ ----
29992+ <web-app xmlns="http://java.sun.com/xml/ns/javaee"
29993+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29994+ xsi:schemaLocation="
29995+ http://java.sun.com/xml/ns/javaee
29996+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
29997+ version="3.0">
29998+
29999+ <filter>
30000+ <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
30001+ <filter-class>org.springframework.~.OpenEntityManagerInViewFilter</filter-class>
30002+ <async-supported>true</async-supported>
30003+ </filter>
30004+
30005+ <filter-mapping>
30006+ <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
30007+ <url-pattern>/*</url-pattern>
30008+ <dispatcher>REQUEST</dispatcher>
30009+ <dispatcher>ASYNC</dispatcher>
30010+ </filter-mapping>
30011+
30012+ </web-app>
30013+
30014+ ----
30015+
2997830016If using Servlet 3, Java based configuration, e.g. via `WebApplicationInitializer`,
2997930017you'll also need to set the "asyncSupported" flag as well as the ASYNC dispatcher type
2998030018just like with `web.xml`. To simplify all this configuration, consider extending
0 commit comments