views:

34

answers:

1

Hello, In a Java web application, is there any way to execute some code after and depending on the HttpServletResponse that has been sent to the client? Thanks in advance.

+3  A: 

You can:

  • make a Filter that has code after the chain.doFilter(request, response) method
  • make a filter that wraps the HttpServletResponse in a custom response object which handles whatever operations you like - in this case - replacing the OutputStream with one that logs the desired information
Bozho
Thanks for the answer!
rvelaz
@rvelaz: If an answer helped in solving the problem, you should then mark the answer accepted.
BalusC