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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
doFilter
(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) void
init
(FilterConfig filterConfig) boolean
shouldAllowRequestBodyRepeatableReads
(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:
init
in interfaceFilter
- Throws:
ServletException
-
destroy
public void destroy() -
doFilter
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException - Specified by:
doFilter
in interfaceFilter
- 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 requesthttpServletResponse
- Servlet requestroute
- The route for this request- Returns:
true
if the filter should be applied,false
otherwise
-