Reputation: 97
I want to know the method of outputting the output buffer of jspWriter to the log. To confirm whether the content of the buffer generated with the content and the server returned to the client is the same, I want to output it to the log file. I want to confirm whether to miss information by the communication by confirming this.
Upvotes: 0
Views: 732
Reputation: 718946
I don't know of a way to do this in the context of the standard Servlet / JSP APIs. Your web server / container might provide a way to capture the response messages, but (for instance) Tomcat doesn't.
I think that your best bet is to use a proxy web service or something like WireShark to capture the responses sent over the wire.
Upvotes: 1
Reputation: 6707
JSPWriter may not be buffered at all, or the buffer may be too small to contain the entire output and be flushed early.
For debugging you should add a new Filter which replaces the HttpServletResponse with a subclass of HttpServletResponseWrapper which over-rides getOutputStream and getWriter to provide implementations that log the output of the JSP as it passes through.
Upvotes: 1