Currently, I have a filter that sets some cache control headers. I need to change these cache control headers in the case of a non-successful response, such as a 404.
Unfortunately, when I check HttpServletReponse.getStatus() in the in my doFilter method, it always reports 200 even if actually a 404 will be sent to the browser. I'm guessing that the response status isn't yet set at the point filters are run. How can I make sending this particular header conditional upon the response code, so that I only send it in the case of a successful response? Brendan