-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

André Warnier wrote:
> Christopher Schultz wrote:
>>
>> The only legal ways I know of are to call getReader and getInputStream.
>> Those are easily handled as I've laid out in previous posts.
> Can you point me to one of these posts ?
> Because at the moment, I don't see this so easily.

Really? I'm talking about this thread you're reading /right now/. I laid
out how to use a unified buffer to handle both request.getReader and
request.getInputStream.

> I assume we can be talking about a POST submitted as
> multi-part/form-data.

Actually, it doesn't matter. It could be PUT as well, or any HTTP method
that allows a request body (or doesn't... I suppose you can read a
request body from any HTTP request, whether it makes sense or not).

> So the body may be large, and it can be read only
> once. You'd need to read it all (binary) and log it while saving it
> somewhere on disk.

You could keep it in memory, too. Presumably such a filter is only
really useful for debugging, so using memory to store the request
doesn't sound too bad to me.

> Then when the getReader or getInputStream call comes, open that saved
> file instead of the original request body.

Well, if getReader is called multiple times, it needs to return the same
reader, in the same place. So you have to keep track of the state of the
reader, etc. It's actually easier than it sounds.

> Considering the possible volume, not something you would really want to
> send to the usual logging mechanism.

Yes, but see my comment on debugging above.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkdnesACgkQ9CaO5/Lv0PBK4gCeN1S+O3PdTmtXgEtudsry3mz2
IzUAn3YkX7HtR4phQj1yZ9/v8z5UpCSg
=QviS
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to