Package com.soklet.web.request
Class SokletFilter
java.lang.Object
com.soklet.web.request.SokletFilter
- All Implemented Interfaces:
Filter
- Since:
- 1.1.2
- Author:
- Mark Allen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) voidinit(FilterConfig filterConfig) booleanshouldAllowRequestBodyRepeatableReads(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Optional<Route> route) Should this request body be cached in-memory to support repeated reads?
-
Field Details
-
STATIC_FILES_URL_PATTERN_PARAM
-
-
Constructor Details
-
SokletFilter
-
-
Method Details
-
init
- Specified by:
initin interfaceFilter- Throws:
ServletException
-
destroy
public void destroy() -
doFilter
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException - Specified by:
doFilterin interfaceFilter- Throws:
IOExceptionServletException
-
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 requesthttpServletResponse- Servlet requestroute- The route for this request- Returns:
trueif the filter should be applied,falseotherwise
-