Package org.opencms.jsp
Class CmsJspTagJsonValue
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.A_CmsJspJsonTag
org.opencms.jsp.CmsJspTagJsonValue
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
Adds a JSON value to the surrounding context and/or stores it as a variable in the page context.
- 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
ConstructorsConstructorDescriptionDefault constructor explicitly resetting all variables. -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Returns the JSON value that should be added to the surrounding context and/or stored in the variable given by the var attribute.protected voidinit()Initializes / resets the internal values.protected voidIf an error variable has been specified, store the given error message in that variable.voidsetErrorVar(String errorVar) Variable to store errors under in the page scope.voidSets the parse attribute.voidSets the value attribute.Methods inherited from class org.opencms.jsp.A_CmsJspJsonTag
addToTarget, getScope, release, setKey, setMode, setScope, setTarget, setVarMethods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, 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
-
CmsJspTagJsonValue
public CmsJspTagJsonValue()Default constructor explicitly resetting all variables.
-
-
Method Details
-
doEndTag
- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classA_CmsJspJsonTag- Throws:
javax.servlet.jsp.JspException- See Also:
-
getJsonValue
Description copied from class:A_CmsJspJsonTagReturns the JSON value that should be added to the surrounding context and/or stored in the variable given by the var attribute.- Specified by:
getJsonValuein classA_CmsJspJsonTag- Returns:
- the value to add/store
- See Also:
-
setErrorVar
Variable to store errors under in the page scope.- Parameters:
errorVar- the error variable
-
setParse
Sets the parse attribute.If set to 'true', the value will be treated as a string and then parsed into JSON.
- Parameters:
parse- the value being set
-
setValue
Sets the value attribute.- Parameters:
value- the JSON value
-
init
Initializes / resets the internal values.- Overrides:
initin classA_CmsJspJsonTag
-
setError
If an error variable has been specified, store the given error message in that variable.- Parameters:
errorMessage- the error message
-