I have a Filter that uses the output stream from the response of the servlet in the chain. In order to do this I create a custom response wrapper that has a custom servlet output stream.
This works fine, but in moving to a newer Java EE API there have been a couple new (abstract) methods added to servlet output stream, and my application needs to (unfortunately) work in both Tomcat 7 and Tomcat 8+. So, is there any other way to capture the response output stream that doesn't rely on this? If not, any recommendations on how to straddle these tomcat/java versions? The only thing I can think of, but haven't tried, is to compile against Tomcat 7, but run that application in Tomcat 8+. Thanks!