Search code examples
javajspweb-applicationsstruts2struts

How to determine page generation time with Struts 2?


I'm using Struts 2 and I'd like to determine the page generation time without an external profiler. I can easily profile the actions execute() method, but I don't know how to include the time spent before (in dispatchers, interceptors...) and after (time taken by the servlet corresponding to the view ("jsp time")).

Is there simple way to do this ? And if there isn't, how could I, at least, profile the "jsp time" (maybe a tag I'm not aware of ?) ? I think it would be accurate enough to just take in account action time + jsp time.


Solution

  • You could use Filters before and after the call to get the time when the request comes in and the response goes out. No profiler needed. And you can configure the Filters in your web.xml to apply to particular URLs.

    It's coarse-grained but effective.