Class CmsJspTagJsonPart

  • All Implemented Interfaces:
    java.io.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:
    Serialized Form
    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doCatch​(java.lang.Throwable arg0)  
      int doEndTag()  
      void doFinally()  
      int doStartTag()  
      java.lang.String getElement()
      Returns the name to be used as the JSON key.
      void setElement​(java.lang.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • doCatch

        public void doCatch​(java.lang.Throwable arg0)
                     throws java.lang.Throwable
        Specified by:
        doCatch in interface javax.servlet.jsp.tagext.TryCatchFinally
        Throws:
        java.lang.Throwable
        See Also:
        TryCatchFinally.doCatch(java.lang.Throwable)
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
        See Also:
        TagSupport.doEndTag()
      • doFinally

        public void doFinally()
        Specified by:
        doFinally in interface javax.servlet.jsp.tagext.TryCatchFinally
        See Also:
        TryCatchFinally.doFinally()
      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
        See Also:
        TagSupport.doStartTag()
      • getElement

        public java.lang.String getElement()
        Returns the name to be used as the JSON key.

        Returns:
        the name to be used as a JSON key
      • setElement

        public void setElement​(java.lang.String elementName)
        Sets the name to be used as a JSON key.

        Parameters:
        elementName - the name to be used as a JSON key