Package org.opencms.jsp
Class CmsJspScopedVarBodyTagSuport
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspScopedVarBodyTagSuport
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
CmsJspTagContentAccess,CmsJspTagContentInfo,CmsJspTagEdit,CmsJspTagFormatter,CmsJspTagNavigation,CmsJspTagResourceAccess,CmsJspTagResourceLoad,CmsJspTagSearch,CmsJspTagSimpleSearch
Parent for body tags that require support for setting scoped variables to the JSP page context.
- Since:
- 7.0.2
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetScope()Returns the scope under which the content access bean is saved in the page context.protected static intgetScopeAsInt(String scope) Returns the int value of the specified scope string.protected static StringgetScopeAsString(int scope) Returns the String value of the specified scope integer.protected intReturns the scope as int usable for setting the JSP page context withJspContext.setAttribute(String, Object, int).getVar()Returns the name of the variable under which the content access bean is saved in the page context.protected booleanReturnstruein case the scoped variable has been set for this Tag.voidrelease()voidSets the scope under which the content access bean is saved in the page context.voidSets the name of the variable under which the content access bean is saved in the page context.protected voidstoreAttribute(Object obj) Stores the provided Object as attribute in the JSP page context.protected voidstoreAttribute(String name, Object obj) Stores the provided Object as attribute with the provided name in the JSP page context.Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
CmsJspScopedVarBodyTagSuport
public CmsJspScopedVarBodyTagSuport()
-
-
Method Details
-
getScopeAsInt
Returns the int value of the specified scope string.The default value is
PageContext.PAGE_SCOPE.- Parameters:
scope- the string name of the desired scope, e.g. "application", "request"- Returns:
- the int value of the specified scope string
-
getScopeAsString
Returns the String value of the specified scope integer.Valid values for the scope int parameter are 1 to 4 only.
- Parameters:
scope- integer that describes the scope according togetScopeInt().- Returns:
- the String value of the specified scope integer
-
getScope
Returns the scope under which the content access bean is saved in the page context.- Returns:
- the scope under which the content access bean is saved in the page context
-
getVar
Returns the name of the variable under which the content access bean is saved in the page context.- Returns:
- the name of the variable under which the content access bean is saved in the page context
-
release
- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classjavax.servlet.jsp.tagext.BodyTagSupport- See Also:
-
setScope
Sets the scope under which the content access bean is saved in the page context.- Parameters:
scope- the scope under which the content access bean is saved in the page context
-
setVar
Sets the name of the variable under which the content access bean is saved in the page context.- Parameters:
var- the name of the variable under which the content access bean is saved in the page context
-
getScopeInt
Returns the scope as int usable for setting the JSP page context withJspContext.setAttribute(String, Object, int).- Returns:
- the scope as int usable for setting the JSP page context
-
isScopeVarSet
Returnstruein case the scoped variable has been set for this Tag.- Returns:
truein case the scoped variable has been set for this Tag
-
storeAttribute
Stores the provided Object as attribute in the JSP page context.The values of
getVar()andgetScope()are used to determine how the Object is stored.- Parameters:
obj- the Object to store in the JSP page context
-
storeAttribute
Stores the provided Object as attribute with the provided name in the JSP page context.The value of
getScope()is used to determine how the Object is stored.- Parameters:
name- the name of the attribute to store the Object inobj- the Object to store in the JSP page context
-