# Package org.springframework.web.filter

@NonNullApi @NonNullFields package org.springframework.web.filter
Provides generic filter base classes allowing for bean-style configuration.

Related Packages
Package
Description
org.springframework.web
Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.
org.springframework.web.filter.reactive
`WebFilter` implementations for use in reactive web applications.
Class
Description
AbstractRequestLoggingFilter
Base class for `Filter`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 servlet `Filter` that just delegates its behavior to a chain (list) of user-supplied filters, achieving the functionality of a `FilterChain`, but conveniently using only `Filter` instances.
CorsFilter
`Filter` to handle CORS pre-flight requests and intercept CORS simple and actual requests with a `CorsProcessor`, and to update the response, for example, with CORS response headers, based on the policy matched through the provided `CorsConfigurationSource`.
DelegatingFilterProxy
Proxy for a standard Servlet Filter, delegating to a Spring-managed bean that implements the Filter interface.
FormContentFilter
`Filter` that parses form data for HTTP PUT, PATCH, and DELETE requests and exposes it as Servlet request parameters.
ForwardedHeaderFilter
Extract values from "Forwarded" and "X-Forwarded-*" headers, wrap the request and response, and make they reflect the client-originated protocol and address in the following methods: `getServerName()` `getServerPort()` `getScheme()` `isSecure()` `sendRedirect(String)`.
GenericFilterBean
Simple base implementation of `Filter` which treats its config parameters (`init-param` entries within the `filter` tag in `web.xml`) as bean properties.
HiddenHttpMethodFilter
`Filter` that converts posted method parameters into HTTP methods, retrievable via `HttpServletRequest.getMethod()`.
OncePerRequestFilter
Filter base class that aims to guarantee a single execution per request dispatch, on any servlet container.
RelativeRedirectFilter
Overrides `HttpServletResponse.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 both `LocaleContextHolder` and `RequestContextHolder`.
ServerHttpObservationFilter
`Filter` that creates `observations` for HTTP exchanges.
ServletContextRequestLoggingFilter
Simple request logging filter that writes the request URI (and optionally the query string) to the ServletContext log.
ServletRequestPathFilter
`Filter` that `parses and caches` a `RequestPath` that can then be accessed via `ServletRequestPathUtils.getParsedRequestPath(jakarta.servlet.ServletRequest)`.
ShallowEtagHeaderFilter
`Filter` that generates an `ETag` value based on the content on the response.
UrlHandlerFilter
`Filter` that modifies the URL, and then redirects or wraps the request to apply the change.
UrlHandlerFilter.Builder
Builder for `UrlHandlerFilter`.
UrlHandlerFilter.Builder.TrailingSlashSpec
A spec to configure a trailing slash handler.