I'd like to log parts of the post body at the end of the request
handling. The way it's currently being done, the servlet pulls the
content out of the post body stream, instantiates json objects from
it, and throws it away. The stream on the request can't be reset,
because it wasn't marked, and hence the post body content is no longer
available.

I see two options to retain the post body:

1) (Token bad suggestion) Have a servlet filter that marks the stream,
reads the stream, grabs off what it wants, makes a request attribute
and then resets the stream for later processing by the JsonRpcServlet.
Sounds redundant and inefficient as it has the stream being read
twice.

2) (What I propose) Have a servlet filter that reads the stream, and
stashes the post body as a request attribute in a filter. Modify
JsonRpcServlet to retrieve the attribute the same way that my
end-of-request logging will once the post body as attribute is
available.

Is this cool with everyone? If so, I can whip up a patch. Other
suggestions are welcome if it is not.

Thanks,
Bob Evans

Reply via email to