Has anyone tried this?
 
In the servlet you can simply do the following:
 
   PrintWriter out;
 
   boolean supportCompression = false;
   if (request instanceof HttpServletRequest) {
     Enumeration e =
((HttpServletRequest)request).getHeaders("Accept-Encoding");
     while (e.hasMoreElements()) {
       String name = (String)e.nextElement();
       if (name.indexOf("gzip") != -1) {
          supportCompression = true;
       }
     }
   }

   if (!supportCompression) {
    System.out.println("--------------------------------------> NOT
COMPRESSING"); 
    out.getWriter(); 
   }
   else {
    System.out.println("-------------------------------------->
COMPRESSING");
    
    if (response instanceof HttpServletResponse) {
      OutputStream out1 = response.getOutputStream();
      out = new PrintWriter(new GZIPOutputStream(out1), false));
      response.setHeader("Content-Encoding", "gzip"); 
    }
   } 
 
But because I'm using struts, changing the JSP page into a servlet will b
difficult if not impossible. 
Does anyone know of another way around this?
 
cheers,
Chico.  
 

-- 
The content of this e-mail is confidential, may contain privileged material
and is intended solely for the recipient(s) named above. If you receive this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS

Reply via email to