Save This Page
Home » oscache-2.4.1-full » com.opensymphony.oscache » web » tag » [javadoc | source]
com.opensymphony.oscache.web.tag
public class: UseCachedTag [javadoc | source]
java.lang.Object
   javax.servlet.jsp.tagext.TagSupport
      com.opensymphony.oscache.web.tag.UseCachedTag

All Implemented Interfaces:
    IterationTag, Serializable

UseCachedTag is a tag that tells a <cache> tag to reuse the cached body.

Usage Example:


<%@ taglib uri="oscache" prefix="cache" %>
<cache:cache key="mycache" scope="application">
if (reuse cached)
<cache:usecached />
else
some other logic
</cache:cache>
Note this is very useful with try / catch blocks so that you can still produce old cached data if an exception occurs, eg your database goes down.

Field Summary
 boolean use     
Method from com.opensymphony.oscache.web.tag.UseCachedTag Summary:
doStartTag,   setUse
Methods from javax.servlet.jsp.tagext.TagSupport:
doAfterBody,   doEndTag,   doStartTag,   findAncestorWithClass,   getId,   getParent,   getValue,   getValues,   release,   removeValue,   setId,   setPageContext,   setParent,   setValue
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.oscache.web.tag.UseCachedTag Detail:
 public int doStartTag() throws JspTagException 
    The start tag.
 public  void setUse(boolean value) 
    Set the decision to use the body content of the ancestor <cache> or not.