Class UIComponentTag

  • All Implemented Interfaces:
    BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
    Direct Known Subclasses:

    public abstract class UIComponentTag
    extends UIComponentClassicTagBase
    implements Tag
    Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the Jakarta Expression Language API introduced as part of Jakarta Server Pages 2.1.

    UIComponentTag is the base class for all Jakarta Server Pages custom actions that correspond to user interface components in a page that is rendered by Jakarta Server Faces.

    In this version of the specification, UIComponentTag extends UIComponentClassicTagBase to add properties that use the Faces 1.1 Expression Language.

    • Constructor Detail

      • UIComponentTag

        public UIComponentTag()
    • Method Detail

      • setBinding

        public void setBinding​(java.lang.String binding)
                        throws JspException

        Set the value binding expression for our component.

        binding - The new value binding expression
        java.lang.IllegalArgumentException - if the specified binding is not a valid value binding expression.
        JspException - if the binding cannot be set
      • hasBinding

        protected boolean hasBinding()
        Description copied from class: UIComponentClassicTagBase

        Return true if this component has a non-null binding attribute. This method is necessary to allow subclasses that expose the binding property as an Faces 1.1 style Expression Language property as well as subclasses that expose it as a Jakarta Expression Language API property.

        Specified by:
        hasBinding in class UIComponentClassicTagBase
        whether or not this component has a binding attribute
      • setRendered

        public void setRendered​(java.lang.String rendered)

        Set an override for the rendered attribute.

        rendered - The new value for rendered attribute
      • isSuppressed

        protected boolean isSuppressed()
      • isValueReference

        public static boolean isValueReference​(java.lang.String value)

        Return true if the specified value conforms to the syntax requirements of a value binding expression. Such expressions ` * may be used on most component tag attributes to signal a desire for deferred evaluation of the attribute or property value to be set on the underlying UIComponent.

        value - The value to evaluate
        whether or not this value has the correct syntax for a value binding expression
        java.lang.NullPointerException - if value is null
      • release

        public void release()

        Release any resources allocated during the execution of this tag handler.

        Specified by:
        release in interface Tag
        release in class UIComponentClassicTagBase
      • setProperties

        protected void setProperties​(UIComponent component)
        Description copied from class: UIComponentClassicTagBase

        Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is added to the view.

        Tag subclasses that want to support additional set properties must ensure that the base class setProperties() method is still called. A typical implementation that supports extra properties foo and bar would look something like this:

         protected void setProperties(UIComponent component) {
             if (foo != null) {
                 component.setAttribute("foo", foo);
             if (bar != null) {
                 component.setAttribute("bar", bar);

        The default implementation overrides the following properties:

        • rendered - Set if a value for the rendered property is specified for this tag handler instance.
        • rendererType - Set if the getRendererType() method returns a non-null value.
        Specified by:
        setProperties in class UIComponentClassicTagBase
        component - UIComponent whose properties are to be overridden
      • getParentUIComponentTag

        public static UIComponentTag getParentUIComponentTag​(PageContext context)

        Locate and return the nearest enclosing UIComponentTag if any; otherwise, return null.

        context - PageContext for the current page
        the parent tag