Top Description Inners Fields Constructors Methods
javax.faces.webapp

public abstract Class UIComponentTag

extends UIComponentClassicTagBase
implements Tag
Class Inheritance
All Implemented Interfaces
javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.JspTag
Known Direct Subclasses
javax.faces.webapp.UIComponentTag.UIComponentTagAdapter, javax.faces.webapp.UIComponentBodyTag
Imports
javax.faces.application.Application, javax.faces.component.UIComponent, javax.faces.context.FacesContext, javax.faces.el.ValueBinding, javax.servlet.jsp.JspException, .PageContext, javax.servlet.jsp.tagext.Tag

Deprecated

Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the EL API introduced as part of JSP 2.1.

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

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
UIComponentTag.UIComponentTagAdapter

Deprecated as a consequence of UIComponentTag being deprecated.
This adatper exposes a UIComponentClassicTagBase as a UIComponentTag for 1.1 component libraries that rely on UIComponent.getParentUIComponentTag().

Field Summary

Modifier and TypeField and Description
private String
binding

The value binding expression (if any) used to wire up this component to a UIComponent property of a JavaBean class.

private String
rendered

An override for the rendered attribute associated with our UIComponent.

private boolean
suppressed

Flag indicating whether or not rendering should occur.

Inherited from javax.faces.webapp.UIComponentClassicTagBase:
bodyContentnamingContainerChildIdspageContextUNIQUE_ID_PREFIX

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected UIComponent
createComponent(FacesContext
FacesContext for the current request
context
,
String
id of the component
newId
)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.createComponent.

Implement createComponent using Faces 1.1 EL API.

public static UIComponentTag

Returns:

the parent tag
getParentUIComponentTag
(PageContext
PageContext for the current page
context
)

Deprecated as a consequence of UIComponentTag being deprecated.

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

protected boolean
hasBinding()

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

Return true if this component has a non-null binding attribute.

protected boolean
public static boolean

Returns:

whether or not this value has the correct syntax for a value binding expression
isValueReference
(String
The value to evaluate
value
)

Return true if the specified value conforms to the syntax requirements of a value binding expression.

public void
release()

Overrides javax.faces.webapp.UIComponentClassicTagBase.release.

Implements javax.servlet.jsp.tagext.Tag.release.

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

public void
setBinding(String
The new value binding expression
binding
)

Set the value binding expression for our component.

protected void
setProperties(UIComponent
UIComponent whose properties are to be overridden
component
)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.setProperties.

Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.

public void
setRendered(String
The new value for rendered attribute
rendered
)

Set an override for the rendered attribute.

Inherited from javax.faces.webapp.UIComponentClassicTagBase:
addChildaddChildToComponentAndTagaddFacetaddVerbatimAfterComponentaddVerbatimBeforeComponentcreateVerbatimComponentcreateVerbatimComponentFromBodyContentdoAfterBodydoEndTagdoInitBodydoStartTagencodeBeginencodeChildrenencodeEndfindComponentgetBodyContentgetComponentInstancegetCreatedgetCreatedComponentsgetDoAfterBodyValuegetDoEndValuegetDoStartValuegetFacesContextgetFacesJspIdgetFacetNamegetIdgetIndexOfNextChildTaggetJspIdgetParentgetParentUIComponentClassicTagBasegetPreviousOutsetBodyContentsetIdsetJspIdsetPageContextsetParentsetupResponseWriter

Field Detail

bindingback to summary
private String binding

The value binding expression (if any) used to wire up this component to a UIComponent property of a JavaBean class.

renderedback to summary
private String rendered

An override for the rendered attribute associated with our UIComponent.

suppressedback to summary
private boolean suppressed

Flag indicating whether or not rendering should occur.

Constructor Detail

UIComponentTagback to summary
public UIComponentTag()

Method Detail

createComponentback to summary
protected UIComponent createComponent(FacesContext context, String newId)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.createComponent.

Implement createComponent using Faces 1.1 EL API.

Parameters
context:FacesContext

Doc from javax.faces.webapp.UIComponentClassicTagBase.createComponent.

FacesContext for the current request

newId:String

Doc from javax.faces.webapp.UIComponentClassicTagBase.createComponent.

id of the component

Returns:UIComponent

Doc from javax.faces.webapp.UIComponentClassicTagBase.createComponent.

the created component

Annotations
@Override
getParentUIComponentTagback to summary
public static UIComponentTag getParentUIComponentTag(PageContext context)

Deprecated

as a consequence of UIComponentTag being deprecated. See corresponding docs for further information.

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

Parameters
context:PageContext

PageContext for the current page

Returns:UIComponentTag

the parent tag

hasBindingback to summary
protected boolean hasBinding()

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

Doc from javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

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 EL property as well as subclasses that expose it as an EL API property.

Returns:boolean

whether or not this component has a binding attribute

Annotations
@Override
isSuppressedback to summary
protected boolean isSuppressed()
isValueReferenceback to summary
public static boolean isValueReference(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.

Parameters
value:String

The value to evaluate

Returns:boolean

whether or not this value has the correct syntax for a value binding expression

Exceptions
NullPointerException:
if value is null
releaseback to summary
public void release()

Overrides javax.faces.webapp.UIComponentClassicTagBase.release.

Implements javax.servlet.jsp.tagext.Tag.release.

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

Annotations
@Override
setBindingback to summary
public void setBinding(String binding) throws JspException

Set the value binding expression for our component.

Parameters
binding:String

The new value binding expression

Exceptions
JspException:
if the binding cannot be set
IllegalArgumentException:
if the specified binding is not a valid value binding expression.
setPropertiesback to summary
protected void setProperties(UIComponent component)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.setProperties.

Doc from javax.faces.webapp.UIComponentClassicTagBase.setProperties.

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) {
  super.setProperties(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.
Parameters
component:UIComponent

UIComponent whose properties are to be overridden

Annotations
@Override
setRenderedback to summary
public void setRendered(String rendered)

Set an override for the rendered attribute.

Parameters
rendered:String

The new value for rendered attribute

javax.faces.webapp back to summary

private Class UIComponentTag.UIComponentTagAdapter

extends UIComponentTag
Class Inheritance

Deprecated

as a consequence of UIComponentTag being deprecated. See corresponding docs for further information.

This adatper exposes a UIComponentClassicTagBase as a UIComponentTag for 1.1 component libraries that rely on UIComponent.getParentUIComponentTag(). This will work for most use cases, but there are probably some edge cases out there that we're not aware of.

Field Summary

Modifier and TypeField and Description
pack-priv UIComponentClassicTagBase

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
doEndTag()

Overrides javax.faces.webapp.UIComponentClassicTagBase.doEndTag.

Implements javax.servlet.jsp.tagext.Tag.doEndTag.

Process the end tag for this instance.
public int
public UIComponent
getComponentInstance()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getComponentInstance.

Return the UIComponent instance that is associated with this tag instance.

public String
getComponentType()

Implements abstract javax.faces.webapp.UIComponentTagBase.getComponentType.

Return the component type for the component that is or will be bound to this tag.

public boolean
getCreated()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getCreated.

Return true if we dynamically created a new component instance during execution of this tag.

public Tag
getParent()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getParent.

Implements javax.servlet.jsp.tagext.Tag.getParent.

Get the parent (closest enclosing tag handler) for this tag handler.
public String
getRendererType()

Implements abstract javax.faces.webapp.UIComponentTagBase.getRendererType.

Return the rendererType property that selects the Renderer to be used for encoding this component, or null to ask the component to render itself directly.

public void
setParent(Tag
The parent tag, or null.
parent
)

Overrides javax.faces.webapp.UIComponentClassicTagBase.setParent.

Implements javax.servlet.jsp.tagext.Tag.setParent.

Set the parent (closest enclosing tag handler) of this tag handler.
Inherited from javax.faces.webapp.UIComponentTag:
createComponentgetParentUIComponentTaghasBindingisSuppressedisValueReferencereleasesetBindingsetPropertiessetRendered

Field Detail

classicDelegateback to summary
pack-priv UIComponentClassicTagBase classicDelegate

Constructor Detail

UIComponentTagAdapterback to summary
public UIComponentTagAdapter(UIComponentClassicTagBase classicDelegate)

Method Detail

doEndTagback to summary
public int doEndTag() throws JspException

Overrides javax.faces.webapp.UIComponentClassicTagBase.doEndTag.

Implements javax.servlet.jsp.tagext.Tag.doEndTag.

Doc from javax.servlet.jsp.tagext.Tag.doEndTag.

Process the end tag for this instance. This method is invoked by the JSP page implementation object on all Tag handlers.

This method will be called after returning from doStartTag. The body of the action may or may not have been evaluated, depending on the return value of doStartTag.

If this method returns EVAL_PAGE, the rest of the page continues to be evaluated. If this method returns SKIP_PAGE, the rest of the page is not evaluated, the request is completed, and the doEndTag() methods of enclosing tags are not invoked. If this request was forwarded or included from another page (or Servlet), only the current page evaluation is stopped.

The JSP container will resynchronize the values of any AT_BEGIN and AT_END variables (defined by the associated TagExtraInfo or TLD) after the invocation of doEndTag().

Returns:int

indication of whether to continue evaluating the JSP page.

Annotations
@Override
Exceptions
JspException:
if an error occurred while processing this tag
doStartTagback to summary
public int doStartTag() throws JspException

Overrides javax.faces.webapp.UIComponentClassicTagBase.doStartTag.

Implements javax.servlet.jsp.tagext.Tag.doStartTag.

Doc from javax.servlet.jsp.tagext.Tag.doStartTag.

Process the start tag for this instance. This method is invoked by the JSP page implementation object.

The doStartTag method assumes that the properties pageContext and parent have been set. It also assumes that any properties exposed as attributes have been set too. When this method is invoked, the body has not yet been evaluated.

This method returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED to indicate that the body of the action should be evaluated or SKIP_BODY to indicate otherwise.

When a Tag returns EVAL_BODY_INCLUDE the result of evaluating the body (if any) is included into the current "out" JspWriter as it happens and then doEndTag() is invoked.

BodyTag.EVAL_BODY_BUFFERED is only valid if the tag handler implements BodyTag.

The JSP container will resynchronize the values of any AT_BEGIN and NESTED variables (defined by the associated TagExtraInfo or TLD) after the invocation of doStartTag(), except for a tag handler implementing BodyTag whose doStartTag() method returns BodyTag.EVAL_BODY_BUFFERED.

Returns:int

EVAL_BODY_INCLUDE if the tag wants to process body, SKIP_BODY if it does not want to process it.

Annotations
@Override
Exceptions
JspException:
if an error occurred while processing this tag
getComponentInstanceback to summary
public UIComponent getComponentInstance()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getComponentInstance.

Doc from javax.faces.webapp.UIComponentClassicTagBase.getComponentInstance.

Return the UIComponent instance that is associated with this tag instance. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

Returns:UIComponent

Doc from javax.faces.webapp.UIComponentTagBase.getComponentInstance.

the component

Annotations
@Override
getComponentTypeback to summary
public String getComponentType()

Implements abstract javax.faces.webapp.UIComponentTagBase.getComponentType.

Doc from javax.faces.webapp.UIComponentTagBase.getComponentType.

Return the component type for the component that is or will be bound to this tag. This value can be passed to javax.faces.application.Application#createComponent to create the UIComponent instance for this tag. Subclasses must override this method to return the appropriate value.

Returns:String

the component type

Annotations
@Override
getCreatedback to summary
public boolean getCreated()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getCreated.

Doc from javax.faces.webapp.UIComponentClassicTagBase.getCreated.

Return true if we dynamically created a new component instance during execution of this tag. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

Returns:boolean

Doc from javax.faces.webapp.UIComponentTagBase.getCreated.

the result as specified above

Annotations
@Override
getParentback to summary
public Tag getParent()

Overrides javax.faces.webapp.UIComponentClassicTagBase.getParent.

Implements javax.servlet.jsp.tagext.Tag.getParent.

Doc from javax.servlet.jsp.tagext.Tag.getParent.

Get the parent (closest enclosing tag handler) for this tag handler.

The getParent() method can be used to navigate the nested tag handler structure at runtime for cooperation among custom actions; for example, the findAncestorWithClass() method in TagSupport provides a convenient way of doing this.

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.

Returns:Tag

the current parent, or null if none.

Annotations
@Override
getRendererTypeback to summary
public String getRendererType()

Implements abstract javax.faces.webapp.UIComponentTagBase.getRendererType.

Doc from javax.faces.webapp.UIComponentTagBase.getRendererType.

Return the rendererType property that selects the Renderer to be used for encoding this component, or null to ask the component to render itself directly. Subclasses must override this method to return the appropriate value.

Returns:String

the renderer type

Annotations
@Override
setParentback to summary
public void setParent(Tag parent)

Overrides javax.faces.webapp.UIComponentClassicTagBase.setParent.

Implements javax.servlet.jsp.tagext.Tag.setParent.

Doc from javax.servlet.jsp.tagext.Tag.setParent.

Set the parent (closest enclosing tag handler) of this tag handler. Invoked by the JSP page implementation object prior to doStartTag().

This value is *not* reset by doEndTag() and must be explicitly reset by a page implementation.

Parameters
parent:Tag

The parent tag, or null.

Annotations
@Override