按上篇文章配置之后,并不能成功执行,后来测试发现把oscache.tld放到/WEB-INF/下然后,配置web.xml文件
<taglib>
<taglib-uri>/WEB-INF/oscache.tld</taglib-uri>
<taglib-location>/WEB-INF/oscache.tld</taglib-location>
</taglib>
然后页面内容如下就可以了。
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.*" %>
<%@ taglib uri="/WEB-INF/oscache.tld" prefix="oscache" %>
<html>
<body>
<oscache:cache time = "10">
<%=System.currentTimeMillis()%><p>
</oscache:cache>
<%=System.currentTimeMillis()%><p>
</body>
</html>