org.springframework.web.filter
Class HttpPutFormContentFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.HttpPutFormContentFilter
- All Implemented Interfaces:
- Aware, BeanNameAware, DisposableBean, InitializingBean, EnvironmentAware, ServletContextAware
public class HttpPutFormContentFilter
- extends OncePerRequestFilter
javax.servlet.Filter
that makes form encoded data available through
the ServletRequest.getParameter*()
family of methods during HTTP PUT
requests.
The Servlet spec requires form data to be available for HTTP POST but
not for HTTP PUT requests. This filter intercepts HTTP PUT 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.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev
Method Summary |
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
Same contract as for doFilter , but guaranteed to be
just invoked once per request. |
private boolean |
isFormContentType(HttpServletRequest request)
|
void |
setCharset(java.nio.charset.Charset charset)
The default character set to use for reading form data. |
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
formConverter
private final FormHttpMessageConverter formConverter
HttpPutFormContentFilter
public HttpPutFormContentFilter()
setCharset
public void setCharset(java.nio.charset.Charset charset)
- The default character set to use for reading form data.
doFilterInternal
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws ServletException,
java.io.IOException
- Description copied from class:
OncePerRequestFilter
- Same contract as for
doFilter
, but guaranteed to be
just invoked once per request. Provides HttpServletRequest and
HttpServletResponse arguments instead of the default ServletRequest
and ServletResponse ones.
- Specified by:
doFilterInternal
in class OncePerRequestFilter
- Throws:
ServletException
java.io.IOException
isFormContentType
private boolean isFormContentType(HttpServletRequest request)