You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Dimitri Valdin <di...@db.com> on 2002/07/11 12:01:08 UTC

problem with Compression Filter

Hello (Amy),

I have found yet another problem with compression filter.
If jsp page uses include action:

        <jsp:include page="/pageToInclude.jsp" flush="true"/>

then a new request is send to server. The result will be compressed
and then compressed once again in the calling page, which make
the result look pretty ugly ;-)

I have found a pretty simple workaround of this problem.
Include action should be extended with parameter gzip:

        <jsp:include page="/pageToInclude.jsp" flush="true">
          <jsp:param name="gzip" value="false"/>
        </jsp:include>

Compression filter will check the request for this parameter
and decide if the page should be compressed or not:

            // Are we allowed to compress ?
            String s = (String) ((HttpServletRequest)request).getParameter("gzip");
            if ("false".equals(s)) {
                if (debug > 0) {
                    System.out.println("got parameter gzip=false --> don't compress, just chain filter");
                }
                chain.doFilter(request, response);
                return;
            }

I have attached the modified Files to this mail. A bit more debugging info
was added to CompressionResponseStream.

Let me know if you have better idea to solve the problem.

BTW, the problem 9434 seems also to be fixed with previous check in.

Regards,

Dmitri Valdin

(See attached file: filter.zip)






--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.