tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: How to view what is sent to the browser
Date Tue, 31 Aug 2004 14:55:56 GMT

Hi,
You can do this easily with an HttpServletResponseWrapper and a Filter.
But if you can modify the servlet, you can do this in a very easy (but
somewhat crude way): instead of writing to the Writer you get from the
response, write to a StringWriter, and at the end of your servlet
processing write the contents of this StringWriter both to a log and to
the response's output writer.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: James Sherwood [mailto:jsherwood@romulin.com]
>Sent: Tuesday, August 31, 2004 11:08 AM
>To: Tomcat Users List
>Subject: How to view what is sent to the browser
>
>I am looking for a way to view what is being sent to the browser in the
>servlet.
>
>Lets say I want to create a bad word filter(and cannot use an actual
>filter)
>
>once I get the response, is there a way to manipulate it before it is
sent
>to the browser?
>
>Thanks,
>James
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


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


Mime
View raw message