Class AbstractTag

  • All Implemented Interfaces:
    RequestConstants, jakarta.servlet.jsp.tagext.BodyTag, jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, java.io.Serializable
    Direct Known Subclasses:
    BodyTag, HeadTag, PropertyTag, TitleTag, UsePageTag

    public abstract class AbstractTag
    extends jakarta.servlet.jsp.tagext.BodyTagSupport
    implements RequestConstants
    Convenience implementation of Tag containing generice methods required by all (or most) taglibs.
    Version:
    $Revision: 1.4 $
    Author:
    Joe Walnes
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected jakarta.servlet.jsp.PageContext pageContext  
      protected jakarta.servlet.jsp.tagext.Tag parent  
      • Fields inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

        bodyContent
      • Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

        id
      • Fields inherited from interface jakarta.servlet.jsp.tagext.BodyTag

        EVAL_BODY_BUFFERED
      • Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractTag()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract int doEndTag()
      To be implemented by all empty tags.
      int doStartTag()
      Returns SKIP_BODY.
      protected java.io.Writer getOut()
      Get the outputWriter.
      protected Page getPage()
      Return the Page object from the PAGE scope.
      jakarta.servlet.jsp.tagext.Tag getParent()  
      void release()  
      void setPageContext​(jakarta.servlet.jsp.PageContext pageContext)  
      void setParent​(jakarta.servlet.jsp.tagext.Tag parent)  
      protected static void trace​(java.lang.Exception e)
      Log exception generated by taglib.
      • Methods inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

        doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
      • Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

        findAncestorWithClass, getId, getValue, getValues, removeValue, setId, setValue
      • Methods inherited from class java.lang.Object

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

      • pageContext

        protected jakarta.servlet.jsp.PageContext pageContext
      • parent

        protected jakarta.servlet.jsp.tagext.Tag parent
    • Constructor Detail

      • AbstractTag

        public AbstractTag()
    • Method Detail

      • doEndTag

        public abstract int doEndTag()
                              throws jakarta.servlet.jsp.JspException
        To be implemented by all empty tags.
        Specified by:
        doEndTag in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class jakarta.servlet.jsp.tagext.BodyTagSupport
        Throws:
        jakarta.servlet.jsp.JspException
      • doStartTag

        public int doStartTag()
        Returns SKIP_BODY.
        Specified by:
        doStartTag in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class jakarta.servlet.jsp.tagext.BodyTagSupport
      • release

        public void release()
        Specified by:
        release in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        release in class jakarta.servlet.jsp.tagext.BodyTagSupport
      • getParent

        public jakarta.servlet.jsp.tagext.Tag getParent()
        Specified by:
        getParent in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        getParent in class jakarta.servlet.jsp.tagext.TagSupport
      • setParent

        public void setParent​(jakarta.servlet.jsp.tagext.Tag parent)
        Specified by:
        setParent in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        setParent in class jakarta.servlet.jsp.tagext.TagSupport
      • setPageContext

        public void setPageContext​(jakarta.servlet.jsp.PageContext pageContext)
        Specified by:
        setPageContext in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        setPageContext in class jakarta.servlet.jsp.tagext.TagSupport
      • getPage

        protected Page getPage()
        Return the Page object from the PAGE scope. If this is found in REQUEST scope instead, it will be moved into PAGE scope - to handle multi-level includes.
      • trace

        protected static void trace​(java.lang.Exception e)
        Log exception generated by taglib.
      • getOut

        protected java.io.Writer getOut()
        Get the outputWriter. This method should be used in preference to pageContext.getOut(), as some charset conversions may need to happen in some servers.
        Returns:
        the writer for use in the tag