javax.servlet.jsp.tagext

Class TagSupport

    • Field Detail

      • id

        protected String id
        The value of the id attribute of this tag; or null.
      • pageContext

        protected PageContext pageContext
        The PageContext.
    • Constructor Detail

      • TagSupport

        public TagSupport()
        Default constructor, all subclasses are required to define only a public constructor with the same signature, and to call the superclass constructor. This constructor is called by the code generated by the JSP translator.
    • Method Detail

      • findAncestorWithClass

        public static final Tag findAncestorWithClass(Tag from,
                                                      Class klass)
        Find the instance of a given class type that is closest to a given instance. This method uses the getParent method from the Tag interface. This method is used for coordination among cooperating tags.

        The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.

        When a tag library author provides information on the observable type of a tag handler, client programmatic code should adhere to that constraint. Specifically, the Class passed to findAncestorWithClass should be a subtype of the observable type.

        Parameters:
        from - The instance from where to start looking.
        klass - The subclass of Tag or interface to be matched
        Returns:
        the nearest ancestor that implements the interface or is an instance of the class specified
      • doStartTag

        public int doStartTag()
                       throws JspException
        Default processing of the start tag, returning SKIP_BODY.
        Specified by:
        doStartTag in interface Tag
        Returns:
        SKIP_BODY
        Throws:
        JspException - if an error occurs while processing this tag
        See Also:
        Tag.doStartTag()
      • doEndTag

        public int doEndTag()
                     throws JspException
        Default processing of the end tag returning EVAL_PAGE.
        Specified by:
        doEndTag in interface Tag
        Returns:
        EVAL_PAGE
        Throws:
        JspException - if an error occurs while processing this tag
        See Also:
        Tag.doEndTag()
      • setParent

        public void setParent(Tag t)
        Set the nesting tag of this tag.
        Specified by:
        setParent in interface Tag
        Parameters:
        t - The parent Tag.
        See Also:
        Tag.setParent(Tag)
      • getParent

        public Tag getParent()
        The Tag instance most closely enclosing this tag instance.
        Specified by:
        getParent in interface Tag
        Returns:
        the parent tag instance or null
        See Also:
        Tag.getParent()
      • setId

        public void setId(String id)
        Set the id attribute for this tag.
        Parameters:
        id - The String for the id.
      • getId

        public String getId()
        The value of the id attribute of this tag; or null.
        Returns:
        the value of the id attribute, or null
      • setValue

        public void setValue(String k,
                             Object o)
        Associate a value with a String key.
        Parameters:
        k - The key String.
        o - The value to associate.
      • getValue

        public Object getValue(String k)
        Get a the value associated with a key.
        Parameters:
        k - The string key.
        Returns:
        The value associated with the key, or null.
      • removeValue

        public void removeValue(String k)
        Remove a value associated with a key.
        Parameters:
        k - The string key.
      • getValues

        public Enumeration<String> getValues()
        Enumerate the keys for the values kept by this tag handler.
        Returns:
        An enumeration of all the keys for the values set, or null or an empty Enumeration if no values have been set.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 18:32:45 Cette version de la page est en cache (à la date du 21/08/2025 18:32:45) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 24/12/2007, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/servlet/jsp/tagext/tagsupport.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, TagSupport

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.