Compression filter

  1. Henrik

    Hi there.

    I just installed your Compression Filter in a Struts 1.1 Webapp hosted on a JBoss 3.2.5 Server.
    I notice (from stacktrace) that the filter is activated....and throws an exception. I get my page but with compression I guess.

    <Exception snip>
    15:08:37,864 INFO [STDOUT] java.lang.Exception
    15:08:37,864 INFO [STDOUT] at com.netspade.servlet.compress.CompressionFilt
    er.doFilter(CompressionFilter.java:65)
    15:08:37,864 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:186)
    15:08:37,864 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:157)
    15:08:37,864 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve
    </Exception snip>

    I use "/do/*" as the URL mapping for the filter as all my content is served from Struts actions and forwarded to JSPs (classic Struts style).

    What can be wrong

    Regards

    Henrik

    Posted: 2004-12-01 14:19:55.725230 #

  2. jason

    Oops, sorry about that. I'd left a stack trace in there for debugging purposes and forgot to take it out. I've updated the files now, so hopefully no more exceptions!

    Thanks for reporting,

    Jason

    Posted: 2004-12-01 21:58:09.932280 #

  3. Henrik

    Hi Jason

    Thanx for the ultrafast answer.

    So the Compression Filter is actually compressing my stream? or?

    I thought it was something about the Struts forward mecanism. Is the URL pattern correct if I access my Struts actions this way:

    http://www.myserver.com/do/myAction

    Does the CF work with Struts.?

    Regards and thanx for putting the CF online... :-))

    /Henrik

    Posted: 2004-12-02 08:08:18.054420 #

  4. jason

    Hi Henrik,

    Yes it should compress the stream as long as the browser supports it. The filter checks for the Accept-Encoding header to see if gzip compression is supported.

    I haven't tested it with Struts but it works with forward mechanisms so I can't see why Struts would be a problem.

    I've been thinking it might be useful if I made a tool for checking that this kind of thing is working. If you use Linux, there are several command-line tools (e.g. wget) that could be used to send the appropriate Accept-Encoding header and then you could check that the contents have been compressed. There's an extension for Firefox that's useful for this: http://livehttpheaders.mozdev.org/ - if you click on Tools -> Page Info -> Headers you can check for a response header of Content-Encoding: gzip.

    Cheers,
    Jason

    Posted: 2004-12-03 09:44:47.003274 #

  5. Henrik

    Hi Jason

    Eh...In the new .jar file there is only a few classes...and defininately not the one defined as the filter class in web.xml.

    This is an error, right?

    Can you supply a full jar, please?

    Looking forward to use the filter

    Regards

    Henrik

    Posted: 2004-12-03 12:01:13.884495 #

  6. jason

    The new .jar file contains exactly the same number of classes as the old one. It contains the filter class, com.netspade.servlet.compress.CompressionFilter, as well as two other classes. How many classes are you seeing?

    As far as I can tell, this is the full .jar file.

    Jason

    Posted: 2004-12-04 10:35:00.579393 #

:
: