質問

In a Java servlet based web application, is there any way to execute some code after and depending on the HttpServletResponse that has been sent to the client?

役に立ちましたか?

解決

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top