Is there a way to view the contents of HttpServletResponse?
Thank you.
Printable View
Is there a way to view the contents of HttpServletResponse?
Thank you.
I'm not sure, may be you can use interface called javax.servlet.ServletResponse. One of our Java project we use it to find the set and find the header of a message packet of a chat service.
May be you can find some useful details from there.
I guess the HttpServletResponseWrapper is what you're looking for.
Quote:
Originally Posted by JavaDoc
HttpServletResponseWrapper is not quite what I am looking for.
The ServletRequest object has a method called getReader() that will allow me to view the contents of the body. Is there something analogous to this functionality in ServletResponse?
Did you check the documentation. As far as I remember there is a method as getStream() or getData(), better to check I'm not sure that 100%
I did not see a getStream() or getData() method in the HttpServletResponse object in the javadocs (http://java.sun.com/products/servlet...mr2/index.html)
If there is no way to get the contents of the HttpServletResponse after you written to the object, then why was this functionality excluded?