Class SokletFilter

java.lang.Object
com.soklet.web.request.SokletFilter
All Implemented Interfaces:
Filter

@Singleton public class SokletFilter extends Object implements Filter
Since:
1.1.2
Author:
Mark Allen
  • Field Details

    • STATIC_FILES_URL_PATTERN_PARAM

      public static String STATIC_FILES_URL_PATTERN_PARAM
  • Constructor Details

  • Method Details

    • init

      public void init(FilterConfig filterConfig) throws ServletException
      Specified by:
      init in interface Filter
      Throws:
      ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface Filter
    • doFilter

      public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException
      Specified by:
      doFilter in interface Filter
      Throws:
      IOException
      ServletException
    • shouldAllowRequestBodyRepeatableReads

      public boolean shouldAllowRequestBodyRepeatableReads(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Optional<Route> route)
      Should this request body be cached in-memory to support repeated reads?

      This is helpful for common cases (request body logging and parsing) but if you have special requirements (need non-blocking I/O or have to handle large request bodies like file uploads) then you should override this method to return false.

      By default this method returns true.

      Parameters:
      httpServletRequest - Servlet request
      httpServletResponse - Servlet request
      route - The route for this request
      Returns:
      true if the filter should be applied, false otherwise