freemarker中使用OSCache

第一要在web.xml中加入以下配置
<taglib>
<taglib-uri>oscache</taglib-uri>
<taglib-location>/WEB-INF/classes/oscache.tld</taglib-location>
</taglib>
第二在/web-inf/lib下加入os的jar包
第三在/web-inf/classes下加入oscache的配置文件和tld
第四在freemarker中按如下方法使用

<#assign cache=JspTaglibs["/WEB-INF/classes/oscache.tld"] />
<@cache.cache key="xxx" time=20>
${fowUrlaa}
</@cache.cache>

你可能感兴趣的:(freemarker)