public class HttpPutFormContentFilter extends OncePerRequestFilter
Filter
that makes form encoded data available through
the ServletRequest.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.
ALREADY_FILTERED_SUFFIX
logger
Constructor and Description |
---|
HttpPutFormContentFilter() |
Modifier and Type | Method and Description |
---|---|
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
Same contract as for
doFilter , 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.
|
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
public void setCharset(Charset charset)
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
OncePerRequestFilter
doFilter
, but guaranteed to be
just invoked once per request within a single request thread.
See OncePerRequestFilter.shouldNotFilterAsyncDispatch()
for details.
Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.
doFilterInternal
in class OncePerRequestFilter
ServletException
IOException