Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Executing code before and after each request

Hi,

using Jetty 7, I wonder what is the best way to have code executed for each request, when the request starts being processed and when processing is finished (the response body written fully, or aborted by the client, or any other error).

To illustrate this, suppose that I want to log the start and the end of processing of each request.

Initially I though that a Filter would be appropriate, but although I can get the start of the request, I cannot get the end as the processing is async.
What would be the best way to do this ?

Alternatively, is there any API that returns the current number of pending requests ?





Back to the top