Class FormContentFilter

All Implemented Interfaces:
jakarta.servlet.Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, EnvironmentAware, EnvironmentCapable, ServletContextAware

public class FormContentFilter extends OncePerRequestFilter
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
  • Constructor Details

    • FormContentFilter

      public FormContentFilter()
  • Method Details

    • setFormConverter

      public void setFormConverter(FormHttpMessageConverter converter)
      Set the converter to use for parsing form content.

      By default this is an instance of AllEncompassingFormHttpMessageConverter.

    • 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(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException
      Description copied from class: OncePerRequestFilter
      Same contract as for 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.

      Specified by:
      doFilterInternal in class OncePerRequestFilter
      Throws:
      jakarta.servlet.ServletException
      IOException