Package org.springframework.web.filter
Class FormContentFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.FormContentFilter
- All Implemented Interfaces:
Filter
,Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,EnvironmentAware
,EnvironmentCapable
,ServletContextAware
Filter
that parses form data for HTTP PUT, PATCH, and DELETE requests
and exposes it as Servlet request parameters. By default the Servlet spec
only requires this for HTTP POST.- Since:
- 5.1
- Author:
- Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doFilterInternal
(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as fordoFilter
, but guaranteed to be just invoked once per request within a single request thread.void
setCharset
(Charset charset) The default character set to use for reading form data.void
setFormConverter
(FormHttpMessageConverter converter) Set the converter to use for parsing form content.Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
FormContentFilter
public FormContentFilter()
-
-
Method Details
-
setFormConverter
Set the converter to use for parsing form content.By default this is an instance of
AllEncompassingFormHttpMessageConverter
. -
setCharset
The default character set to use for reading form data. This is a shortcut for:
getFormConverter.setCharset(charset)
. -
doFilterInternal
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException Description copied from class:OncePerRequestFilter
Same contract as fordoFilter
, but guaranteed to be just invoked once per request within a single request thread. SeeOncePerRequestFilter.shouldNotFilterAsyncDispatch()
for details.Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.
- Specified by:
doFilterInternal
in classOncePerRequestFilter
- Throws:
ServletException
IOException
-