Class ExtendJavascriptVarTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
jakarta.servlet.jsp.tagext.BodyTagSupport
com.randomnoun.common.webapp.taglib.ExtendJavascriptVarTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.BodyTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,Serializable
Extends a javascript variable with a server-side resource or request attribute.
The variable may contain any amount of maps or lists, which will be
converted into the javascript equivalent.
Attributes defined for this tag (in common.tld) are:
- baseName - the name of the javascript variable to extend
- name - the name of the object within base (may contain sub-object names separated by '.')
- value - the value of the javascript variable.
- key - if defined, the value of this field within the value object is used to extend the base object. if key is supplied the object is replaced, not merged
Both name and value may contain EL-style expressions.
- Author:
- knoxg
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()doEnd tag handler required to fulfill the Tag interface defined in the JSP specification.intdoStart tag handler required to fulfill the Tag interface defined in the JSP specification.Gets the name of the javascript object to modifyGets the JSON format (e.g.getKey()Gets the name of the field within the object to modifygetName()Gets the name of the javascript variable to generategetValue()Returns the object to convert into javascriptvoidsetBaseName(String baseName) Sets the name of the javascript object to modifyvoidsetJsonFormat(String jsonFormat) Sets the JSON format (e.g.voidSets the name of the field within the object to modifyvoidSets the name of the javascript variable to generatevoidSets the object to convert into javascriptMethods inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class jakarta.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 jakarta.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
ExtendJavascriptVarTag
public ExtendJavascriptVarTag()
-
-
Method Details
-
setBaseName
Sets the name of the javascript object to modify- Parameters:
baseName- the name of the javascript object to modify
-
getBaseName
Gets the name of the javascript object to modify- Returns:
- the name of the javascript object to modify
-
setKey
Sets the name of the field within the object to modify- Parameters:
key- the name of the field within the object to modify
-
getKey
Gets the name of the field within the object to modify- Returns:
- the name of the field within the object to modify
-
setName
Sets the name of the javascript variable to generate- Parameters:
name- the name of the javascript variable to generate
-
getName
Gets the name of the javascript variable to generate- Returns:
- the name of the javascript variable to generate
-
setValue
Sets the object to convert into javascript- Parameters:
value- the object to convert into javascript
-
getValue
Returns the object to convert into javascript- Returns:
- the object to convert into javascript
-
setJsonFormat
Sets the JSON format (e.g. method in which dates are serialised to JSON)- Parameters:
name- the JSON format
-
getJsonFormat
Gets the JSON format (e.g. method in which dates are serialised to JSON)- Returns:
- the JSON format
-
doStartTag
doStart tag handler required to fulfill the Tag interface defined in the JSP specification. This tag is always empty, and therefore must always return BodyTag.SKIP_BODY- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.BodyTagSupport- Returns:
- BodyTag.SKIP_BODY
- Throws:
jakarta.servlet.jsp.JspException
-
doEndTag
doEnd tag handler required to fulfill the Tag interface defined in the JSP specification.This method does nothing, and always returns BodyTag.EVAL_PAGE
- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.BodyTagSupport- Returns:
- BodyTag.EVAL_PAGE
- Throws:
jakarta.servlet.jsp.JspException
-