- All Implemented Interfaces:
- javax.servlet.Filter
public class CleanupSpringRequestAttributesFilter
extends Object
implements javax.servlet.Filter
org.springframework.web.filter.RequestContextFilter (and any OncePerRequestFilter) will set a request attribute
with an instance of WebAsyncManager (by calling
org.springframework.web.context.request.async.WebAsyncUtils#getAsyncManager(javax.servlet.ServletRequest))
If a plugin calls org.springframework.web.context.request.async.WebAsyncUtils#getAsyncManager(javax.servlet.ServletRequest)
it will retrieve that instance of WebAsyncManager, but will cause a ClassCastException, as plugins have different
Spring classes than core.
This filter just removes the attribute, which could be problematic if we want to handle async request properly, so
it should be limited to affected urls only.
One plugin known to use Spring this way is embedded-crowd-admin-plugin.
Class copied from FeCru.