Compress Filter ver. 1.6

This is a Java servlet filter (as per Servlet API 2.3). GzipFilter lets you compress output from your jsp/html pages.

How to use it:

a) download gzipflt.jar and save it in WEB-INF/lib

b) describe this filter in web.xml.
 


<filter>
  <filter-name>GzipFilter</filter-name>
  <filter-class>com.cj.gzipflt.GzipFilter</filter-class>
</filter>

c) describe a mapping for this filter in web.xml
 


<filter-mapping>
  <filter-name>GzipFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
</filter-mapping>

in this case filter will be on for each your .jsp file

And now when you invoke any .jsp page: http://your_host/your_page.jsp GzipFilter will check out client's browser settings. If browser does not support gzip, filter invokes resource normally. If browser does support gzip, output will be compressed.

   For downloading:
    Filter:  gzipflt.jar

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.