I've got a filter that wraps HttpServletResponse like this:
HttpServletRequest httpRequest = (HttpServletRequest)
servletRequest;
HttpServletResponse httpResponse = (HttpServletResponse)
servletResponse;
...
OutputStream out = httpResponse.getOutputStream();
GenericResponseWrapper wrapper = new
GenericResponseWrapper(httpResponse);
filterChain.doFilter(servletRequest, wrapper);
String content = new String(wrapper.getData(),
httpResponse.getCharacterEncoding());
String designedContent = design.process(content, features);
out.write(designedContent.getBytes());
out.close();
The problem comes when I try to inject Provider<HttpServletResponse>.
Injected HttpServletResponse is not an instance of GenericResponseWrapper,
it is a original HttpServletResponse. So it breaks my application.
Maybe it is a correct behavior, but i need to override
HttpServletResponsebinding. How can I achieve it?
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/rmiLj9x_ws0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.