This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
When using Struts, all requests are sent to the Controller Servlet which then executes an Action and finally forwards to a view (I have taken this simple case as an example).
A filter is configured to process the request/response sent to the controller, using <url-pattern> or <servlet-name>. When the controller servlet forwards the request/response to the jsp (view), then the filter (if it is a post-processing filter) tries to write content to the reponse which is currently being used by the jsp (view) to which the forward was made. This causes an Exception to be thrown.
The Servlet 2.3 specification does not state how filters should behave when FORWARDS or INCLUDES are performed using a RequestDispatcher. The 2.4 version of the specification covers this in SRV.6.2.5 Filters and the RequestDispatcher.
I posted a similar note to another thread on this subject:
I think that GZipFilter will not work if the app server applies it twice to the same request, which can happen in 2.3 if there are any server-side forwards.
If I may be so bold as to plug my own work, I have created an open-source compression filter that is faster, cleaner and more comprehensive than GZipFilter. If the above is in fact your problem, you should give my filter a try; it works regardless of how the app server behaves in this situation.