Wouter Lievens
Wouter Lievens

Reputation: 4029

Start and end of web request lifecycle in Spring MVC

I'd like to track & print some diagnostic information (when in debug run) for when a web request starts and when it ends. Is there some kind of event/listener/callback I can register to listen for web request lifecycle events?

To make it more concrete, one of the things (not the only one) I want to do is track how long it took to process the request.

Upvotes: 3

Views: 1604

Answers (1)

Neil McGuigan
Neil McGuigan

Reputation: 48277

If you are using Tomcat as your server, you can try its Request Dumper Filter:

http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter

Otherwise, you could try a HandlerInterceptor in Spring Spring HandlerInterceptor vs Servlet Filters

Upvotes: 1

Related Questions