code: public static void addGzipHeader(final HttpServletResponse response) throws ServletException {
  		response.setHeader("Content-Encoding", "gzip");
  		boolean containsEncoding = response.containsHeader("Content-Encoding");
  		if (!containsEncoding) {
  			throw new ServletException("Failure when attempting to set Content-Encoding: gzip");
  		}
  	}
docs: Adds the gzip HTTP header to the response. This is needed when a gzipped body is returned so that browsers can
  properly decompress it.
  @param response the response which will have a header added to it. I.e this method changes its parameter
  @throws ServletException Either the response is committed or we were called using the
  include method from a
  {@link javax.servlet.RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)}
  method and the set header is ignored.