The JavaEE API comes with the HttpServletResponseWrapper which, to quote the javadoc, "provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet." Without subclassing, this class just passes all calls through to the wrapped response object. There's a similar wrapper for requests.
Can anyone point me at any utility libraries that provide useful subclass implementations of these classes? Particularly, I'm looking for a subclass of the response wrapper that captures the written response (as a String, byte[], whatever's appropriate) and exposes it via an API method.
I've written a rather half-baked version myself, but frankly, I shouldn't have to, and I'd rather throw it away and use one off the shelf.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…