0

I have a custom filter that implements Filter and I wrap the response with a ContentCachingResponseWrapper like this

HttpServletResponse responseWrapper = new ContentCachingResponseWrapper((HttpServletResponse) response);
chain.doFilter(request, responseWrapper);

after that I open localhost and I see nothing, only white screen.

<html>
<head><head>
<body></body>
</html>

If I comment the ContentCachingResponseWrapper and use the response without wrapping it

chain.doFilter(request, response);

then my jsp page is rendered correctly.

Can anyone explain what's happening?

John
  • 446
  • 6
  • 16
  • user7294900, Thank you! I've added this to my interceptor but I forgot to add this to my filter – John Aug 07 '17 at 07:05

1 Answers1

0

After adding ((ContentCachingResponseWrapper) responseWrapper).copyBodyToResponse(); after chain.doFilter(requestToCache, responseWrapper); problem was solved

John
  • 446
  • 6
  • 16