title: Response already committed when using Spring 3.x on Websphere 8.5
body: <p>When adding / updating a response header after the request has been processed I get the following warning:</p>
  
  <pre><code>com.ibm.ws.webcontainer.srt.SRTServletResponse setHeader SRVE8094W: WARNING: Cannot set header. Response already committed. 
  </code></pre>
  
  <p>I am trying to manipulate the header by calling <code>httpServletResponse.setHeader()</code> or <code>httpServletResponse.addHeader()</code> from within a servlet filter after <code>filterChain.doFilter()</code> or by postHandle code spring interceptor.</p>
  
  <p>I have encountered this problem while running my webapp using spring 3.x on websphere 8.5.</p>
  
  <p>The problem is not reproduced on tomcat 7.0 therefore my guess is that it is Websphere related.
  The problem is not reproduced in a pure servlet app therefore my guess is that it is Spring related.</p>
  
  <p>I am familiar with</p>
  
  <p><a href="https://stackoverflow.com/questions/13266744/shallowetagheaderfilter-does-not-work-under-was8-app-server">ShallowEtagHeaderFilter does not work under WAS8 app server</a></p>
  
  <p>and with</p>
  
  <p><a href="https://stackoverflow.com/questions/2030152/srtservletres-w-warning-cannot-set-header-response-already-committed">Cannot set header in JSP. Response already committed</a></p>
  
  <p>but I am looking for a "cleaner" solution.</p>
  
  <p>Can anybody help me on this?</p>