|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opensubsystems.core.www.PageElementCacheTag
public class PageElementCacheTag
Custom tag providing ability to cache elements of the page usually from custom tags and then display them at later point when requested. The main purpose is to allow other tags to specify elements, such as css includes or javascript includes at one spot, e.g. using initialization tag. These elements will then be place on a specific places at the page using this tag. It also allows derived tags to cache their content and then other tags to fetch them and display at other places.
| Field Summary | |
|---|---|
static java.lang.String |
CACHE_INDICATOR
Indicator to use in attributes to signal to retrieve content from the cache. |
static java.lang.String |
CSS_ELEMENT
CSS style sheets cache. |
static java.lang.String |
JS_ELEMENT
JavaScript js import cache. |
protected java.lang.String |
m_strCacheas
If this id is specified then the content will not be printed into output but instead will be cached under id specified in this attribute. |
protected java.lang.String |
m_strId
Id of the cached element to retrieve. |
static java.lang.String |
PAGE_ELEMENTS_CACHE
Messages collected during processing of current request. |
static java.lang.String |
SCRIPT_ELEMENT
JavaScript script cache. |
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
id, pageContext |
| 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 |
| Constructor Summary | |
|---|---|
PageElementCacheTag()
Constructor for custom tag. |
|
| Method Summary | |
|---|---|
protected void |
cache(java.lang.String strPageElementId,
java.lang.String strItemToCache)
Add item for specific page element to the cache. |
int |
doEndTag()
|
int |
doStartTag()
|
java.lang.String |
getCacheas()
|
protected java.lang.String |
getCachedContent(java.lang.String strPageElementId)
Get the cached content. |
protected java.lang.String |
getCachedContent(java.lang.String strPageElementId,
boolean bRemove)
Get the cached content. |
protected java.lang.String |
getCachedContent(java.lang.String strPageElementId,
boolean bRemove,
java.lang.String strSeparator)
Get the cached content. |
protected java.util.List |
getCachedContentElements(java.lang.String strPageElementId,
boolean bRemove)
Get the elements of cached content elements. |
java.lang.String |
getId()
|
void |
setCacheas(java.lang.String strCacheas)
|
void |
setId(java.lang.String strId)
|
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
getParent, setPageContext, setParent |
| Field Detail |
|---|
public static final java.lang.String PAGE_ELEMENTS_CACHE
public static final java.lang.String CSS_ELEMENT
public static final java.lang.String JS_ELEMENT
public static final java.lang.String SCRIPT_ELEMENT
public static final java.lang.String CACHE_INDICATOR
protected java.lang.String m_strId
protected java.lang.String m_strCacheas
| Constructor Detail |
|---|
public PageElementCacheTag()
| Method Detail |
|---|
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic java.lang.String getId()
getId in class javax.servlet.jsp.tagext.TagSupportpublic java.lang.String getCacheas()
public void setId(java.lang.String strId)
setId in class javax.servlet.jsp.tagext.TagSupportstrId - - Id of the cached element to retrieve.public void setCacheas(java.lang.String strCacheas)
strCacheas - - New Id under which the output will be cached
protected void cache(java.lang.String strPageElementId,
java.lang.String strItemToCache)
strPageElementId - - constant representing HTML page element for which
the item will be cachedstrItemToCache - - element to cacheprotected java.lang.String getCachedContent(java.lang.String strPageElementId)
strPageElementId - - id of the cached element to get
protected java.lang.String getCachedContent(java.lang.String strPageElementId,
boolean bRemove,
java.lang.String strSeparator)
strPageElementId - - id of the cached element to getbRemove - - remove the element from the cache after it is retrievedstrSeparator - - separator for particular cached items
protected java.lang.String getCachedContent(java.lang.String strPageElementId,
boolean bRemove)
strPageElementId - - id of the cached element to getbRemove - - remove the element from the cache after it is retrieved
protected java.util.List getCachedContentElements(java.lang.String strPageElementId,
boolean bRemove)
strPageElementId - - id of the cached element to getbRemove - - remove the element from the cache after it is retrieved
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||