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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • doCatch

      public void doCatch(Throwable arg0) throws Throwable
      Specified by:
      doCatch in interface javax.servlet.jsp.tagext.TryCatchFinally
      Throws:
      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 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(String elementName)
      Sets the name to be used as a JSON key.

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