类 HttpPutFormContentFilter
- java.lang.Object
- org.springframework.web.filter.GenericFilterBean
- org.springframework.web.filter.OncePerRequestFilter
- org.springframework.web.filter.HttpPutFormContentFilter
- 所有已实现的接口:
Filter
,Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,EnvironmentAware
,EnvironmentCapable
,ServletContextAware
public class HttpPutFormContentFilter extends OncePerRequestFilter
Filter
that makes form encoded data available through theServletRequest.getParameter*()
family of methods during HTTP PUT or PATCH requests.The Servlet spec requires form data to be available for HTTP POST but not for HTTP PUT or PATCH requests. This filter intercepts HTTP PUT and PATCH requests where content type is
'application/x-www-form-urlencoded'
, reads form encoded content from the body of the request, and wraps the ServletRequest in order to make the form data available as request parameters just like it is for HTTP POST requests.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
从类继承的字段 org.springframework.web.filter.GenericFilterBean
logger
构造器概要
构造器 构造器 说明 HttpPutFormContentFilter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected 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.FormHttpMessageConverter
getFormConverter()
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.从类继承的方法 org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
从类继承的方法 org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
构造器详细资料
HttpPutFormContentFilter
public HttpPutFormContentFilter()
方法详细资料
setFormConverter
public void setFormConverter(FormHttpMessageConverter converter)
Set the converter to use for parsing form content.By default this is an instnace of
AllEncompassingFormHttpMessageConverter
.
getFormConverter
public FormHttpMessageConverter getFormConverter()
setCharset
public void setCharset(Charset charset)
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
从类复制的说明: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.