com.opensymphony.oscache.web.tag
Class UseCachedTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
com.opensymphony.oscache.web.tag.UseCachedTag
- All Implemented Interfaces:
- Serializable, IterationTag, Tag
public class UseCachedTag
- extends TagSupport
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.
- Version:
- $Revision: 254 $
- Author:
- Mike Cannon-Brookes
- See Also:
- Serialized Form
Method Summary |
int |
doStartTag()
The start tag. |
void |
setUse(boolean value)
Set the decision to use the body content of the ancestor <cache> or not. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UseCachedTag
public UseCachedTag()
setUse
public void setUse(boolean value)
- Set the decision to use the body content of the ancestor <cache> or not.
- Parameters:
value
- Whether or not to use the body content. Default is true.
doStartTag
public int doStartTag()
throws JspTagException
- The start tag.
- Specified by:
doStartTag
in interface Tag
- Overrides:
doStartTag
in class TagSupport
- Returns:
- The standard Tag return.
- Throws:
JspTagException
- The standard tag exception thrown.