Kevin-

To use CompressionFilter you 
1)override doFilter method to provide filtering response via previously defined 
'FilterChain'
2)wrap your regular response as a CompressionServletResponse before sending 
back to client (as in this example from Kief Morris)

public void doFilter(ServletRequest request
                         ServletResponse response,

                         FilterChain chain)

        throws IOException, ServletException 

    { 


        long startTime = System.currentTimeMillis();

        chain.doFilter(request, response);

        long stopTime = System.currentTimeMillis();

        System.out.println("Time to execute request: " + (stopTime - startTime) 
+ 

            " milliseconds"); 


    }

Later on in the service() doGet() or doPut() methods check the response to  
build the appropriate CompressionServletResponseWrapper

if (response instanceof HttpServletResponse) {
        CompressionServletResponseWrapper wrappedResponse =

            new 
CompressionServletResponseWrapper((HttpServletResponse)response);

        wrappedResponse.setCompressionThreshold(compressionThreshold);

        if (debug > 0) {

            System.out.println("doFilter gets called with compression");

        }
}

Make SURE the actual class (which is displayed from your web.xml) 
is on your classpath or your class is located in  
$TOMCAT_HOME/webapps/NameOfYourWebApp/WEB-INF/classes)

The example $TOMCAT_HOME\webapps\servlets-examples\WEB-INF\web.xml displays

<filter>
        <filter-name>Compression Filter</filter-name>
        <filter-class>compressionFilters.CompressionFilter</filter-class>
</filter>


HTH
Martin--

*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



  ----- Original Message ----- 
  From: Kevin Mullin 
  To: users@tomcat.apache.org 
  Sent: Friday, September 15, 2006 11:27 AM
  Subject: Help please



  I've just downloaded Tomcat 5.5.17 and am trying to run it on our mainframe 
system that is running z/OS 1.7 operating system.  I am getting a failure in 
Tomcat that says: 
  java.lang.ClassNotFoundException: compressionFilters.CompressionFilter 
  Does anyone know what is causing this, and what I can do to correct it?



        Kevin Mullin
        Sr. Analyst
        IBM Corporation
        (206) 345-7068
        [EMAIL PROTECTED]   

Reply via email to