Package org.opencms.jsp.jsonpart
Class CmsJspTagJsonPart
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.opencms.jsp.jsonpart.CmsJspTagJsonPart
- All Implemented Interfaces:
Serializable
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
,javax.servlet.jsp.tagext.TryCatchFinally
public class CmsJspTagJsonPart
extends javax.servlet.jsp.tagext.TagSupport
implements javax.servlet.jsp.tagext.TryCatchFinally
Tag used to convert the HTML output of this tag's contents to encoded JSON.
It only makes sense to use this tag in combination with the servlet filter org.opencms.jsp.jsonpart.CmsJsonPartFilter. This tag converts the text generated by its contained JSP code and converts it into a special encoded form, which is then used by the filter to generate JSON. The 'element' attribute on this tag can be used to control the JSON key which will be used for the content.
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
doEndTag()
void
int
Returns the name to be used as the JSON key.void
setElement
(String elementName) Sets the name to be used as a JSON key.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
CmsJspTagJsonPart
public CmsJspTagJsonPart()
-
-
Method Details
-
doCatch
- Specified by:
doCatch
in interfacejavax.servlet.jsp.tagext.TryCatchFinally
- Throws:
Throwable
- See Also:
-
TryCatchFinally.doCatch(java.lang.Throwable)
-
doEndTag
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
- See Also:
-
TagSupport.doEndTag()
-
doFinally
- Specified by:
doFinally
in interfacejavax.servlet.jsp.tagext.TryCatchFinally
- See Also:
-
TryCatchFinally.doFinally()
-
doStartTag
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
- See Also:
-
TagSupport.doStartTag()
-
getElement
Returns the name to be used as the JSON key.- Returns:
- the name to be used as a JSON key
-
setElement
Sets the name to be used as a JSON key.- Parameters:
elementName
- the name to be used as a JSON key
-