Werzi2001
11-23-2010, 11:28 AM
Hi,
i have a working servlet/jsp application (working in Resin 4 and Tomcat 6/7). I'd like to add some caching to this application and so i implemented a filter. The problem is that as soon as i use a responsewrapper Resin doesn't produce any output.
Works:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
chain.doFilter(request, response);
}
Blank page:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse httpresponse = (HttpServletResponse) response;
HttpServletResponseWrapper responsecached = new HttpServletResponseWrapper(httpresponse) {};
chain.doFilter(request, responsecached);
}
The responsewrapper does nothing, so why doesn't it work anymore?
Thanks a lot for your help!
Yours
Werzi2001
Edit:
I did some additional research and i think that this is a bug in the ToCharResponseAdapter. The output printed
to this response is not written back to the original response as soon as the original response is wrapped. I think
that this i triggered by a check of "instanceof CauchoResponse"... but i don't know the code good enougth
to say for sure.
i have a working servlet/jsp application (working in Resin 4 and Tomcat 6/7). I'd like to add some caching to this application and so i implemented a filter. The problem is that as soon as i use a responsewrapper Resin doesn't produce any output.
Works:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
chain.doFilter(request, response);
}
Blank page:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse httpresponse = (HttpServletResponse) response;
HttpServletResponseWrapper responsecached = new HttpServletResponseWrapper(httpresponse) {};
chain.doFilter(request, responsecached);
}
The responsewrapper does nothing, so why doesn't it work anymore?
Thanks a lot for your help!
Yours
Werzi2001
Edit:
I did some additional research and i think that this is a bug in the ToCharResponseAdapter. The output printed
to this response is not written back to the original response as soon as the original response is wrapped. I think
that this i triggered by a check of "instanceof CauchoResponse"... but i don't know the code good enougth
to say for sure.