PDA

View Full Version : Resin 4 and HttpServletResponseWrapper


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.

Werzi2001
12-01-2010, 02:08 PM
Any news here? Can anybody of you reproduce this?

alex
12-01-2010, 03:18 PM
Hi Werzi2001, what version of Resin 4 are you trying this with ?
Thx.

Werzi2001
12-01-2010, 04:03 PM
Hi alex,

i am using "Resin Professional 4.0.10 (built Tue, 24 Aug 2010 10:51:07 PDT)".

Yours
Thomas

alex
12-01-2010, 08:47 PM
Thomas,

There's been a few wrapper bugs fixed since 4.0.10, can you check with 4.1.13? Also, if you see the problem persist, please check the logs for any errors. Turning logging level up to finest may be very helpful for us too, in case there are things logged at level above info.

Thanks,
Alex

Werzi2001
12-09-2010, 03:30 PM
Hi alex,

i updated to 4.1.13 but the problem still exists.

Yours
Thomas