I’m trying to report on every HTTP status code returned from my webapp. However the status code does not appear to be accessible via the ServletResponse, or even if I cast it to a HttpServletResponse. Is there a way to get access to this value within a ServletFilter?
Share
First, you need to save the status code in an accessible place. The best to wrap the response with your implementation and keep it there:
In order to use this wrapper, you need to add a servlet filter, were you can do your reporting: