Originally posted by Bear Bibeault:
Rather, I'd implement a servler filter, wrap the response in a response wrapper, and grab the response buffer for writing to disk on the way out.
I roughed out a demo app that does this a while back.
I never posted it on my site but the war file is still there if you want it
http://simple.souther.us/capture.war It displays the
tomcat home page and, at the same time, using the technique that Bear just described, dumps the output to stdout.