oscache配置

在web.xml中配置
<!--oscahce配置开始-->
<!--引入oscahce标签库-->
<taglib>
<taglib-uri>oscache</taglib-uri>
<taglib-location>/WEB-INF/classes/oscache.tld</taglib-location>
</taglib>

    <filter>
        <filter-name>CacheFilter</filter-name>
        <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
    </filter>

    <filter>
        <filter-name>CacheFilter-disableCacheOnMethods</filter-name>
        <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
        <init-param>
            <param-name>time</param-name>
            <param-value>600</param-value>
        </init-param>
        <init-param>
            <param-name>disableCacheOnMethods</param-name>
            <param-value>POST,PUT,DELETE</param-value>
        </init-param>
        <init-param>
         <param-name>scope</param-name>
         <param-value>session</param-value>
     </init-param>
        <init-param>
            <param-name>oscache-properties-file</param-name>
            <param-value>/WEB-INF/classes/oscache.properties</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>CacheFilter</filter-name>
        <!--<url-pattern>*.do</url-pattern>-->
        <url-pattern>/*</url-pattern>
    </filter-mapping>
<!--oscahce配置结束-->


需要引入的jar包:
oscache-2.4.1.jar,commons-logging.jar

你可能感兴趣的:(OScache)