com.taggercat.tags
Class CacheContentTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.taggercat.tags.CacheContentTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class CacheContentTag
- extends javax.servlet.jsp.tagext.BodyTagSupport
This tags caches provides very simple caching of its body content
onto the specified scope variable.
The body content is also sent to the output stream.
your content to cache
Later in your page you can print the content directly from the cache using:
Note that this tag is equivalent to:
...
and then:
${cachedFragment}
- See Also:
- Serialized Form
-

| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
|
Method Summary |
int |
doAfterBody()
|
int |
doEndTag()
|
int |
doStartTag()
|
void |
setScope(java.lang.String scope)
Sets the scope the attribute will be saved under. |
void |
setVar(java.lang.String varName)
Sets the attribute name the results will be saved under. |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
CacheContentTag
public CacheContentTag()
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
doAfterBody
public int doAfterBody()
throws javax.servlet.jsp.JspException
- Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
setScope
public void setScope(java.lang.String scope)
- Sets the scope the attribute will be saved under.
- Parameters:
scope - sets the scope attribute of the tag The scope can be one of:
- page - default if not specified
- session
- request
- application
setVar
public void setVar(java.lang.String varName)
- Sets the attribute name the results will be saved under.
- Parameters:
varName - the name in the 'var' attribute of the tag