Class MessageTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.BodyTag
,jakarta.servlet.jsp.tagext.IterationTag
,jakarta.servlet.jsp.tagext.JspIdConsumer
,jakarta.servlet.jsp.tagext.JspTag
,jakarta.servlet.jsp.tagext.Tag
public class MessageTag extends UIComponentELTag
-
Field Summary
Fields inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX
-
Constructor Summary
Constructors Constructor Description MessageTag()
-
Method Summary
Modifier and Type Method Description int
doEndTag()
Perform any processing necessary to handle the content implications of CASE 3 in the class description.int
doStartTag()
Perform any processing necessary to find (or create) theUIComponent
instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author.String
getComponentType()
Return the component type for the component that is or will be bound to this tag.String
getDebugString()
String
getRendererType()
Return therendererType
property that selects theRenderer
to be used for encoding this component, ornull
to ask the component to render itself directly.void
release()
Release any resources allocated during the execution of this tag handler.void
setDir(jakarta.el.ValueExpression dir)
void
setErrorClass(jakarta.el.ValueExpression errorClass)
void
setErrorStyle(jakarta.el.ValueExpression errorStyle)
void
setFatalClass(jakarta.el.ValueExpression fatalClass)
void
setFatalStyle(jakarta.el.ValueExpression fatalStyle)
void
setFor(jakarta.el.ValueExpression _for)
void
setInfoClass(jakarta.el.ValueExpression infoClass)
void
setInfoStyle(jakarta.el.ValueExpression infoStyle)
void
setLang(jakarta.el.ValueExpression lang)
protected void
setProperties(UIComponent component)
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.void
setRole(jakarta.el.ValueExpression role)
void
setShowDetail(jakarta.el.ValueExpression showDetail)
void
setShowSummary(jakarta.el.ValueExpression showSummary)
void
setStyle(jakarta.el.ValueExpression style)
void
setStyleClass(jakarta.el.ValueExpression styleClass)
void
setTitle(jakarta.el.ValueExpression title)
void
setTooltip(jakarta.el.ValueExpression tooltip)
void
setWarnClass(jakarta.el.ValueExpression warnClass)
void
setWarnStyle(jakarta.el.ValueExpression warnStyle)
Methods inherited from class jakarta.faces.webapp.UIComponentELTag
createComponent, getELContext, hasBinding, setBinding, setRendered
Methods inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doAfterBody, doInitBody, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getDoEndValue, getDoStartValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriter
-
Constructor Details
-
MessageTag
public MessageTag()
-
-
Method Details
-
setFor
public void setFor(jakarta.el.ValueExpression _for) -
setShowDetail
public void setShowDetail(jakarta.el.ValueExpression showDetail) -
setShowSummary
public void setShowSummary(jakarta.el.ValueExpression showSummary) -
setDir
public void setDir(jakarta.el.ValueExpression dir) -
setErrorClass
public void setErrorClass(jakarta.el.ValueExpression errorClass) -
setErrorStyle
public void setErrorStyle(jakarta.el.ValueExpression errorStyle) -
setFatalClass
public void setFatalClass(jakarta.el.ValueExpression fatalClass) -
setFatalStyle
public void setFatalStyle(jakarta.el.ValueExpression fatalStyle) -
setInfoClass
public void setInfoClass(jakarta.el.ValueExpression infoClass) -
setInfoStyle
public void setInfoStyle(jakarta.el.ValueExpression infoStyle) -
setLang
public void setLang(jakarta.el.ValueExpression lang) -
setRole
public void setRole(jakarta.el.ValueExpression role) -
setStyle
public void setStyle(jakarta.el.ValueExpression style) -
setStyleClass
public void setStyleClass(jakarta.el.ValueExpression styleClass) -
setTitle
public void setTitle(jakarta.el.ValueExpression title) -
setTooltip
public void setTooltip(jakarta.el.ValueExpression tooltip) -
setWarnClass
public void setWarnClass(jakarta.el.ValueExpression warnClass) -
setWarnStyle
public void setWarnStyle(jakarta.el.ValueExpression warnStyle) -
getRendererType
Description copied from class:UIComponentTagBase
Return the
rendererType
property that selects theRenderer
to be used for encoding this component, ornull
to ask the component to render itself directly. Subclasses must override this method to return the appropriate value.- Specified by:
getRendererType
in classUIComponentTagBase
- Returns:
- the renderer type
-
getComponentType
Description copied from class:UIComponentTagBase
Return the component type for the component that is or will be bound to this tag. This value can be passed to
Application.createComponent(java.lang.String)
to create theUIComponent
instance for this tag. Subclasses must override this method to return the appropriate value.- Specified by:
getComponentType
in classUIComponentTagBase
- Returns:
- the component type
-
setProperties
Description copied from class:UIComponentELTag
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 theUIComponent
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 propertiesfoo
andbar
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 therendered
property is specified for this tag handler instance.rendererType
- Set if thegetRendererType()
method returns a non-null value.
- Overrides:
setProperties
in classUIComponentELTag
- Parameters:
component
-UIComponent
whose properties are to be overridden
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionDescription copied from class:UIComponentClassicTagBase
Perform any processing necessary to find (or create) the
UIComponent
instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author. Secondarily, cause a transientUIOutput
component to be created and placed in the tree before theUIComponent
instance for this tag. The value of thisUIOutput
component must include anything covered byCASE 1
orCASE 2
in the class description.The default implementation, which is intended to be sufficient for most components, implements this secondary requirement by calling
UIComponentClassicTagBase.getParentUIComponentClassicTagBase(jakarta.servlet.jsp.PageContext)
, and callingUIComponentClassicTagBase.createVerbatimComponentFromBodyContent()
on the result. It then adds the returned component to the tree before the actual component for this tag instance instance by callingUIComponentClassicTagBase.addVerbatimBeforeComponent(jakarta.faces.webapp.UIComponentClassicTagBase, jakarta.faces.component.UIComponent, jakarta.faces.component.UIComponent)
.Before returning, the component is pushed onto the component stack for this response to enable the
UIComponentClassicTagBase.getParentUIComponentClassicTagBase(jakarta.servlet.jsp.PageContext)
method to work properly.The flag value to be returned is acquired by calling the
getDoStartValue()
method, which tag subclasses may override if they do not want the default value.- Specified by:
doStartTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classUIComponentClassicTagBase
- Throws:
jakarta.servlet.jsp.JspException
- if an error occurs
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionDescription copied from class:UIComponentClassicTagBase
Perform any processing necessary to handle the content implications of CASE 3 in the class description.
The default implementation, which is intended to be sufficient for most components, calls
UIComponentClassicTagBase.createVerbatimComponentFromBodyContent()
on this instance and adds it as a child of the component for this tag's component at the end of the child list. In addition, the following housekeeping steps are taken.- Retrieve from the
UIComponent
the set of component ids of child components created byUIComponentTag
instances the last time this page was processed (if any). Compare it to the list of children created during this page processing pass, and remove all children present in the old list but not the new. Save the new list as a component attribute so that it gets saved as part of the component's state. - Retrieve from the
UIComponent
the set of facet names of facets created byUIComponentTag
instances the last time this page was processed (if any). Compare it to the list of facets created during this page processing pass, and remove all facets present in the old list but not the new. Save the new list as a component attribute so that it gets saved as part of the component's state. - Release all references to the component, and pop it from the component stack for this response, removing the stack if this was the outermost component.
The flag value to be returned is acquired by calling the
getDoEndValue()
method, which tag subclasses may override if they do not want the default value.- Specified by:
doEndTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classUIComponentClassicTagBase
- Throws:
jakarta.servlet.jsp.JspException
- if an error occurs
- Retrieve from the
-
release
public void release()Description copied from class:UIComponentELTag
Release any resources allocated during the execution of this tag handler.
- Specified by:
release
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
release
in classUIComponentELTag
-
getDebugString
-