-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Alex,

On 1/15/18 12:47 PM, Alex O'Ree wrote:
> On Mon, Jan 15, 2018 at 12:27 PM, Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
> Alex,
> 
> On 1/13/18 9:03 PM, Alex O'Ree wrote:
>>> After googling, I've found the request dumper valve, but I was 
>>> wondering if there was an equivalent for response content? I
>>> have been able to rig up a http servlet filter that can capture
>>> and log response messages but i was looking for a more
>>> universal way to accomplish this for all http
>>> requests/responses to tomcat.
>> 
>> Have a look at this: 
>> http://markmail.org/message/fumpfuspt7a3nesz
> 
> Thanks Chris, I do have a similar solution using servlet filters, 
> however i was looking for a solution using a valve. I do not know 
> much about how valves work yet but i'm digging through the source 
> now...

A Valve is essentially a Filter except that it will run *before* all
application-defined Filters and it has access to the request/response
objects at a lower level than a Filter would.

Most of those lower-level interfaces also implement the e.g.
HttpServletRequest/HttpServletResponse interfaces, so much of the code
can be copied verbatim from my example.

Or you can use my code as a starting point to write a Valve that uses
those lower-level interfaces. There are no built-in wrappers for
Tomcat's Request and Response objects, though, so "wrapping" them just
requires more work. (I did propose wrapper classes for those, but was
discouraged from adding them to Tomcat proper. You can look in BZ for
some very old code that does that.)

What are you actually trying to accomplish, here? Perhaps neither a
Valve nor a Filter is the best solution.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpc7QIdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFj4Cw/+Pa+7kG123Q5r3msd
vRhPZR0ZWMZhfmy0Nwvdt1GRNkNRfyUmfurHCcaIHU00Q4AJejdMUm77vIEutyPs
s0r0n6NucE7Aqh2oXgNNowkscs942YcD5A7XumY873GIVqVfxysYVKIWMR8pRwRZ
wCn0x2c9bEX/RfuflHbfQT/0VLRET2WYMj19gTWVXKOk/fINus3PPdBMeys/vq8n
MsWgf0ya2RTB3lTaSEAD7S7UegdAWccRvuxa8BHbO9iWOdqE3dacx5JVr9GHt1n/
Geoi6owZSBxqJF5wUlPVBPsFaB7muC/P9D6FnKbvG9wPV0XbkxuWL+9jE6HGTKt7
2hJTZaomJIZNGTrfFktt2lJkfz14CCtR8wT+CpCttGr1Hi+skSUuqoyODDTGsaRL
QPeYWooyFrdNYscbdrt2LYgtbYm7FpNdc4wpaRKsYMVJ62KPdvFafHI0KsMVWhG+
n6hQuoheIIUWkjidF8dir2bSloAknriVwON+yFk1ttqAFh1SW8AMjwVOc1BOr/hk
3GxMYT4RQgrx/bZKYVnPA6nPkE1+gnV7+KmKHzItZQXf3c2CrG6TMTK6cZjm9yuo
tcBu4syf0eb0dTTEKvZ+J0od8w05pk4AhsyLSXjZ7D/O1Ek0pVqirq/Cz+SOySY9
JHoeTIqmKvySus/8OuJGUrSgK2o=
=n7jQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to