程序包 org.springframework.web.filter
Provides generic filter base classes allowing for bean-style configuration.
类概要 类 说明 AbstractRequestLoggingFilter Base class forFilter
s that perform logging operations before and after a request is processed.CharacterEncodingFilter Servlet Filter that allows one to specify a character encoding for requests.CommonsRequestLoggingFilter Simple request logging filter that writes the request URI (and optionally the query string) to the Commons Log.CompositeFilter A generic composite servletFilter
that just delegates its behavior to a chain (list) of user-supplied filters, achieving the functionality of aFilterChain
, but conveniently using onlyFilter
instances.CorsFilter Filter
that handles CORS preflight requests and intercepts CORS simple and actual requests thanks to aCorsProcessor
implementation (DefaultCorsProcessor
by default) in order to add the relevant CORS response headers (likeAccess-Control-Allow-Origin
) using the providedCorsConfigurationSource
(for example anUrlBasedCorsConfigurationSource
instance.DelegatingFilterProxy Proxy for a standard Servlet Filter, delegating to a Spring-managed bean that implements the Filter interface.ForwardedHeaderFilter Extract values from "Forwarded" and "X-Forwarded-*" headers in order to wrap and override the following from the request and response:getServerName()
,getServerPort()
,getScheme()
,isSecure()
, andsendRedirect(String)
.GenericFilterBean Simple base implementation ofFilter
which treats its config parameters (init-param
entries within thefilter
tag inweb.xml
) as bean properties.HiddenHttpMethodFilter Filter
that converts posted method parameters into HTTP methods, retrievable viaHttpServletRequest.getMethod()
.HttpPutFormContentFilter Filter
that makes form encoded data available through theServletRequest.getParameter*()
family of methods during HTTP PUT or PATCH requests.Log4jNestedDiagnosticContextFilter 已过时。 as of Spring 4.2.1, in favor of Apache Log4j 2 (following Apache's EOL declaration for log4j 1.x)OncePerRequestFilter Filter base class that aims to guarantee a single execution per request dispatch, on any servlet container.RelativeRedirectFilter OverridesHttpServletResponse.sendRedirect(String)
and handles it by setting the HTTP status and "Location" headers, which keeps the Servlet container from re-writing relative redirect URLs into absolute ones.RequestContextFilter Servlet Filter that exposes the request to the current thread, through bothLocaleContextHolder
andRequestContextHolder
.ServletContextRequestLoggingFilter Simple request logging filter that writes the request URI (and optionally the query string) to the ServletContext log.ShallowEtagHeaderFilter Filter
that generates anETag
value based on the content on the response.