You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stefan Görling <st...@pricerunner.com> on 2004/02/09 15:46:15 UTC

Stealing the Writer (Was: Re: Configuring a Default Servlet)

Dear Tim,

Thanks!, Filters works great to solve this problem. Here's another 
stupid thing I want to do. I want to measure the performance, by 
wrapping every request buy another filter (or similiar):

public void doFilter(ServletRequest request, ServletResponse, response, 
FilterChain chain) throws IOException, ServletException {
    ServletOutputStream out=response.getOutputStream();

    out.println("<!-- request started -->")
    chain.doFilter(request,response);
    out.println("<!-- This is the end of the request, it took foo 
seconds-->");

}

The page is delivered properly, but the debug output is not returned. If 
i remove chain.doFitlter, the text is printed properly. Anyone who has 
an idea on how to "Steal" a working writer to add some debug data at the 
end (start is not really necessary)?

/Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org