Class ContentCachingRequestWrapper

All Implemented Interfaces:
HttpServletRequest, ServletRequest

public class ContentCachingRequestWrapper extends HttpServletRequestWrapper
HttpServletRequest wrapper that caches all content read from the input stream and reader, and allows this content to be retrieved via a byte array.

This class acts as an interceptor that only caches content as it is being read but otherwise does not cause content to be read. That means if the request content is not consumed, then the content is not cached, and cannot be retrieved via getContentAsByteArray().

Used e.g. by AbstractRequestLoggingFilter.

Since:
4.1.3
Author:
Juergen Hoeller, Brian Clozel
See Also: