Cache Off filter ver. 1.3


This is a Java servlet filter (as per Servlet API 2.3). This filter lets you disable a cache for requested resources. Technically this filter just adds appropriate headers to incoming request and disables cache.

How to use it:

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

b) describe this filter in web.xml:
 


<filter>
  <filter-name>CacheOffFilter</filter-name>
  <filter-class>com.cj.cacheoff.CacheOffFilter</filter-class>
</filter>

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


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

in this example filter will be on for the each .jsp file. So for the each jsp file filter will disable caching. You can provide your own path here of course.

Also you may exclude some of your files from the processing. Parameter exclude contains a commas separated list of files excluded from the processing. E.g.:
 


<filter>
  <filter-name>CacheOffFilter</filter-name>
  <filter-class>com.cj.cacheoff.CacheOffFilter</filter-class>
  <init-param>
    <param-name>exclude</param-name>
    <param-value>/main.htm</param-value>
  </init-param>
</filter>

   For downloading:

    Cache Off filter:  cacheoffflt.jar
 

 ©  Coldbeans     Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in JSOS: