1 Reply Latest reply on Oct 24, 2002 5:22 AM by Julian Gosnell

    GZIP and content encoding

    Greg Newbie

      Dear all,

      I've transferred an application from Orion to JBoss and have found a difference in how I need to get GZIP compresison going.

      I'm using a filter to implement compression, and i'm finding that under JBoss I need to set the content encoding to "gzip" as soon as a request is received in my MVC controller servlet.

      Under Orion, I used to just allow the filter to check the Accept-Encoding header value and then the filter would handle all gzip'ing requirements:

      a) set content encoding to gzip
      b) zip the page contents

      I'd prefer not to have to set content encoding in the MVC controller servlet since it breaks the pluggability of simply adding a <filter-mapping> to turn compression on.

      i.e. it's working in JBoss but not in the optimally designed way.

      Has anyone got gzip compression going under JBoss using filters, and/or be able to offer suggestions about the intricacies of setting the content encoding of a page?

      I'm just wondering if content encoding is being somehow set by default, and then under JBoss, the filter is unable to override a content encoding value that has been set.

      I can see by my log4j output where i'm changing the content encoding to gzip, and even though the GZIPFilter sets encoding to gzip, Internet Explorer 6.0 displays garbled (zipped) output and does not unzip it unless, as mentioned, I have set content encoding to gzip when I first received the request in my servlet.

      Any help much appreciated,