문제

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