Methods Summary |
---|
public int | doEndTag()doEndTag just resets all the valiables in case the tag is reused
_key = null;
_scope = PageContext.APPLICATION_SCOPE;
return EVAL_PAGE;
|
public int | doStartTag()doStartTag is called when the flush tag is encountered. By
the time this is called, the tag attributes are already set.
// get the cache from the specified scope
Cache cache = CacheUtil.getCache(pageContext, _scope);
// generate the cache key using the user specified key.
if (_key != null) {
String key = CacheUtil.generateKey(_key, pageContext);
// remove the entry for the key
cache.remove(key);
if (_debugLog)
_logger.fine("FlushTag: clear ["+ key +"]");
} else {
// clear the entire cache
cache.clear();
if (_debugLog)
_logger.fine("FlushTag: clear cache");
}
return SKIP_BODY;
|
public void | setKey(java.lang.String key)This is set a key for the cache element that needs to be cleared
if (key != null && key.length() > 0)
_key = key;
|
public void | setScope(java.lang.String scope)Sets the scope of the cache.
_scope = CacheUtil.convertScope(scope);
|