All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.faces.metadata.taglib.faces.core.taglib.xml Maven / Gradle / Ivy





    Jakarta Faces Core Tag Library

The core Jakarta Faces tags that are independent of any particular RenderKit.

]]>
jakarta.faces.core Register an ActionListener instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
actionListener com.sun.faces.facelets.tag.faces.core.ActionListenerHandler binding false jakarta.faces.event.ActionListener If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
type false java.lang.String
Register an AjaxBehavior instance on one or more UIComponents implementing the ClientBehaviorHolder interface. This tag may be nested witin a single component (enabling Ajax for a single component), or it may be "wrapped" around multiple components (enabling Ajax for many components).

The String value for ids specified for execute and render may be specified as a search expression as outlined in the JavaDocs for UIComponent.findComponent(). The implementation must resolve these ids as specified for UIComponent.findComponent(). For example, consider the following Facelets code.

  1. <h:form id="form_1">
  2.   <h:panelGrid id="panel_1" rows="2">
  3.     <!-- content irrelevant -->
  4.   </h:panelGrid>
  5. </h:form>
  6.  
  7. <h:form id="form_2">
  8.   <h:commandButton id="button">
  9.     <f:ajax render=":form1:panel_1 panel_2" />
  10.   </h:commandButton>
  11.   <h:panelGrid id="panel_2">
  12.     <!-- content irrelevant -->
  13.   </h:panelGrid>
  14. </h:form>

When the button is pressed, panel_1, in form_1 will be re-rendered, along with panel_2 in form_2.

]]>
ajax com.sun.faces.facelets.tag.faces.core.AjaxHandler If less than delay milliseconds elapses between calls to request() only the most recent one is sent and all other requests are discarded. If this option is not specified, or if the value of delay is the literal string 'none' without the quotes, no delay is used.

]]>
delay false java.lang.String
A value of "true" indicates the AjaxBehavior should not be rendered. A value of "false" indicates the AjaxBehavior should be rendered. "false" is the default.

]]>
disabled false java.lang.Boolean
A String or ValueExpression (that evalulates to a String) identifying the type of event the Ajax action will apply to. If specified, it must be one of the events supported by the component the Ajax behavior is being applied to. For HTML components this would be the set of supported DOM events for the component, plus "action" for Faces ActionSource components and "valueChange" for Faces EditableValueHolder components. If not specified, the default event is determined for the component. The DOM event name is the actual DOM event name (for example: "click") as opposed to (for example: "onclick").

]]>
event false java.lang.String
Evaluates to Collection<String>. This is a space separated list of search expressions to components that will participate in the "execute" portion of the Request Processing Lifecycle. See the javadoc for SearchKeywordResolver for the complete list of keywords. If a literal is specified the ids must be space delimited. If not specified, the default value of "@this" is assumed. For example, @this clientIdOne clientIdTwo.

When nested within a composite component, and the value contains or implies the keyword @this, then the keyword must be remapped to the targets attribute of the associated <composite:clientBehavior> declaration, if any, else if the value is not an absolute search expression, then it must be reinterpreted relative to the location of the <f:ajax> declaration.

]]>
execute false java.util.Collection
If "true" behavior events generated from this behavior are broadcast during Apply Request Values phase. Otherwise, the events will be broadcast during Invoke Aplications phase

]]>
immediate false java.lang.Boolean
Method expression referencing a method that will be called when an AjaxBehaviorEvent has been broadcast for the listener.

]]>
listener false public void processAjaxBehavior(jakarta.faces.event.AjaxBehaviorEvent event) throws jakarta.faces.event.AbortProcessingException
The name of the JavaScript function that will handle errors.

]]>
onerror false java.lang.String
The name of the JavaScript function that will handle UI events.

]]>
onevent false java.lang.String
Evaluates to Collection<String>. The search expressions to components that will participate in the "render" portion of the Request Processing Lifecycle. See the javadoc for SearchKeywordResolver for the complete list of keywords. If a literal is specified the identifiers must be space delimited. If not specified, the default value of "@none" is assumed. For example, @this clientIdOne clientIdTwo.

When nested within a composite component, and the value contains or implies the keyword @this, then the keyword must be remapped to the client ID of the associated <composite:implementation>, else if the value is not an absolute search expression, then it must be reinterpreted relative to the location of the <f:ajax> declaration.

]]>
render false java.util.Collection
Reset specific input values. Interpret the value of the render attribute as a space separated list of client identifiers suitable for passing directly to UIViewRoot.resetValues(). The implementation must cause an ActionListener to be attached to the ActionSource component in which this tag is nested that calls UIViewRoot.resetValues() passing the value of the render attribute as the argument.

]]>
resetValues false java.lang.Boolean
Add an attribute to the UIComponent associated with the closest parent UIComponent tag.

]]>
attribute com.sun.faces.facelets.tag.faces.core.AttributeHandler The name of the component attribute to be set.

]]>
name java.lang.String
The value of the component attribute to be set.

]]>
value java.lang.Object
Add attributes to the UIComponent associated with the closest parent UIComponent tag. For each Map.Entry in the Map<String, Object> referenced by the value attribute of this tag, take the following action. If parent.getAttributes().containsKey(entry.getKey()) returns true, take no action for this entry. Otherwise, if entry.getValue() is a ValueExpression call parent.setValueExpression(entry.getKey(), entry.getValue()). Otherwise, call parent.getAttributes.put(entry.getKey(), entry.getValue()).

]]>
attributes com.sun.faces.facelets.tag.faces.core.AttributesHandler An EL ValueExpression that evaluates to a Map<String, Object>.

]]>
value true java.util.Map
Register a DateTimeConverter instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
convertDateTime jakarta.faces.DateTime com.sun.faces.facelets.tag.faces.core.ConvertDateTimeHandler A ValueExpression that evaluates to an instance of jakarta.faces.convert.DateTimeConverter.

]]>
binding jakarta.faces.convert.DateTimeConverter
Predefined formatting style which determines how the date component of a date string is to be formatted and parsed. Applied only if type is "date", "both", "localDate", "localDateTime", or "zonedDateTime". Valid values are "default", "short", "medium", "long", and "full". Default value is "default". If a java.time formatter is being used, yet the dateStyle is set to "default", the value "medium" is assumed.

]]>
dateStyle java.lang.String
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Locale whose predefined styles for dates and times are used during formatting or parsing. If not specified, the Locale returned by FacesContext.getViewRoot().getLocale() will be used. Value must be either a VB expression that evaluates to a java.util.Locale instance, or a String that is valid to pass as the first argument to the constructor java.util.Locale(String language, String country). The empty string is passed as the second argument.

]]>
locale false java.lang.Object
Custom formatting pattern which determines how the date/time string should be formatted and parsed.

]]>
pattern java.lang.String
Predefined formatting style which determines how the time component of a date string is to be formatted and parsed. Applied only if type is "time", "both", "localTime" or "offsetTime". Valid values are "default", "short", "medium", "long", and "full". Default value is "default". If a java.time formatter is being used, yet the timeStyle is set to "default", the value "medium" is assumed.

]]>
timeStyle java.lang.String
Time zone in which to interpret any time information in the date String. Value must be either a ValueExpression that evaluates to a java.util.TimeZone instance, or a String that is a timezone ID as described in the javadocs for java.util.TimeZone.getTimeZone().

]]>
timeZone java.lang.Object
Specifies what contents the string value will be formatted to include, or parsed expecting. Valid values are "date", "time", "both", "localDate", "localDateTime", "localTime", "offsetTime", "offsetDateTime", and "zonedDateTime". The values starting with "local", "offset" and "zoned" correspond to Java SE 8 Date Time API classes in package java.time with the name derived by upper casing the first letter. For example, java.time.LocalDate for the value "localDate". Default value is "date".

]]>
type java.lang.String
tag. ]]> convertNumber jakarta.faces.Number com.sun.faces.facelets.tag.faces.core.ConvertNumberHandler A ValueExpression that evaluates to an instance of jakarta.faces.convert.NumberConverter.

]]>
binding jakarta.faces.convert.NumberConverter
ISO 4217 currency code, applied only when formatting currencies.

]]>
currencyCode java.lang.String
Currency symbol, applied only when formatting currencies.

]]>
currencySymbol java.lang.String
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Flag specifying whether formatted output will contain grouping separators. Expressions must evaluate to a boolean. Default value is true.

]]>
groupingUsed java.lang.Boolean
Flag specifying whether only the integer part of the value will be formatted and parsed. Expressions must evaluate to a boolean. Default value is false.

]]>
integerOnly java.lang.Boolean

Locale whose predefined styles for numbers are used during formatting and parsing. If not specified, the Locale returned by FacesContext.getViewRoot().getLocale() will be used. Expressions must evaluate to a java.util.Locale or a String that is valid to pass as the first argument to the constructor java.util.Locale(String language, String country). The empty string is passed as the second argument.

]]>
locale java.lang.Object
Maximum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.

]]>
maxFractionDigits java.lang.Integer
Maximum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.

]]>
maxIntegerDigits java.lang.Integer
Minimum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.

]]>
minFractionDigits java.lang.Integer
Minimum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.

]]>
minIntegerDigits java.lang.Integer
Custom formatting pattern which determins how the number string should be formatted and parsed.

]]>
pattern java.lang.String
Specifies how the number string will be formatted and parsed. Valid values are "number", "currency", and "percent". Default value is "number".

]]>
type java.lang.String
Register a named Converter instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
converter com.sun.faces.facelets.tag.faces.core.ConvertDelegateHandler A ValueExpression that evaluates to an object that implements jakarta.faces.convert.Converter.

]]>
binding jakarta.faces.convert.Converter
Converter identifier of the Converter instance to be created and registered. ]]> converterId java.lang.String If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Allow Jakarta Faces page authors to install ComponentSystemEventListener instances on a component in a page.

]]>
event com.sun.faces.facelets.tag.faces.core.EventHandler The expression must evaluate to a public method that takes a ComponentSystemEvent parameter, with a return type of void, or to a public method that takes no arguments with a return type of void. In the latter case, the method has no way of easily knowing where the event came from, but this can be useful in cases where a notification is needed that "an event happened".

]]>
listener true public void listener(jakarta.faces.event.ComponentSystemEvent event) throws jakarta.faces.event.AbortProcessingException
Name of the event for which to install a listener. The following table lists the valid values for this attribute, and the corresponding event type for which the listener action is registered.

value for "type" tag attribute Type of event sent to listener method
preRenderComponent jakarta.faces.event.PreRenderComponentEvent
preRenderView jakarta.faces.event.PreRenderViewEvent
postAddToView jakarta.faces.event.PostAddToViewEvent
preValidate jakarta.faces.event.PreValidateEvent
postValidate jakarta.faces.event.PostValidateEvent

In addition to these values, the fully qualified class name of any java class that extends jakarta.faces.event.ComponentSystemEvent may be used as the value of the "type" attribute.

Also, the @jakarta.faces.event.NamedEvent annotation may be attached to any java class that extends jakarta.faces.event.ComponentSystemEvent. This enables that event to be referenced from this attribute, as descibed in the javadocs for @NamedEvent.

]]>
type true java.lang.String
Register a named facet on the UIComponent associated with the closest parent UIComponent tag.

When the facet contains more than one child the children will be automatically put in a container UIPanel.

]]>
facet com.sun.faces.facelets.tag.faces.core.FacetHandler Name of the facet to be created.

]]>
name true java.lang.String
Used inside of the metadata facet of a view, this tag will import a mapping of all constant field values of the given type in the current view. Constant field values are all public static final fields of the given type. The map key represents the constant field name as String. The map value represents the actual constant field value. This works for classes, interfaces and enums.

]]>
importConstants jakarta.faces.ImportConstants The fully qualified name of the type to import the constant field values for.

]]>
type true java.lang.String
Name of request scope attribute under which constants will be exposed as a Map. Defaults to the simple name of the given type.

]]>
var false
Load a resource bundle localized for the Locale of the current view, and expose it as a java.util.Map in the request attributes of the current request under the key specified by the value of the "var" attribute of this tag. The Map must behave such that if a get() call is made for a key that does not exist in the Map, the literal string ???KEY??? is returned from the Map, where KEY is the key being looked up in the Map, instead of a MissingResourceException being thrown. If the ResourceBundle does not exist, a TagAttributeException must be thrown.

]]>
loadBundle com.sun.faces.facelets.tag.faces.core.LoadBundleHandler Base name of the resource bundle to be loaded.

]]>
basename java.lang.String
Name of a request scope attribute under which the resource bundle will be exposed as a Map.

]]>
var true java.lang.String
Declare the metadata facet for this view. This must be a child of the <f:view>. This tag must reside within the top level XHTML file for the given viewId, or in a template client, but not in a template. The implementation must insure that the direct child of the facet is a UIPanel, even if there is only one child of the facet. The implementation must set the id of the UIPanel to be the value of the UIViewRoot.METADATA_FACET_NAME symbolic constant.

The implementation must allow templating for this element according to the following pattern.

template client XHTML view, view01.xhtml

  1. <ui:composition template="template.xhtml">
  2.     <ui:define name="metadata">
  3.       <f:metadata>
  4.         <f:viewParam name="id"/>
  5.       </f:metadata>
  6.     </ui:define>
  7.     <ui:define name="content">
  8.         <h1>The big news stories of the day</h1>
  9.     </ui:define>
  10. </ui:composition>

Note line 4. The page author must ensure that the <f:metadata> element does not appear on a template or included page. It must reside on the root page that corresponds to the viewId.

The template page, template.xhtml

  1. <html xmlns="http://www.w3.org/1999/xhtml"
  2.       xmlns:ui="jakarta.faces.facelets"
  3.       xmlns:f="jakarta.faces.core"
  4.       xml:lang="en" lang="en">
  5.  
  6. <body>
  7. <f:view>
  8.    
  9.         <ui:insert name="metadata"/>
  10.    
  11.     <div id="container">
  12.         <ui:insert name="content"/>
  13.     </div>
  14. </f:view>
  15. </body>
  16. </html>

The page author is not required to use templating, but if they do, it must be done as shown above, (or with <ui:include> in a similar manner).

]]> metadata com.sun.faces.facelets.tag.faces.core.MetadataHandler Add a child UIParameter component to the UIComponent associated with the closest parent UIComponent tag.

]]>
param jakarta.faces.Parameter ValueExpression to a backing bean property bound to the component instance for the UIComponent created by this tag.

]]>
binding jakarta.faces.component.UIComponent
Flag enabling or disabling the inclusion of the parameter. This flag is consulted by renderers that consider the UIParameter component associated with this during their rendering. Such renderers include jakarta.faces.Output jakarta.faces.Link and jakarta.faces.OutcomeTarget jakarta.faces.Link.

]]>
disable boolean
Component identifier of the UIParameter component to be created.

]]>
id false java.lang.String
Name of the parameter to be created.

]]>
name java.lang.String
Value of the parameter to be set.

]]>
value java.lang.String
Add an attribute to the passThroughAttributes Map of the UIComponent associated with the closest parent UIComponent tag.

]]>
passThroughAttribute com.sun.faces.facelets.tag.faces.core.PassThroughAttributeHandler The name of the pass through attribute. An attribute with this name, and the corresponding value will appear on the outer most markup element in the rendered markup for the component, as specified in the overview for the HTML_BASIC RenderKit. If the name of this attribute conflicts with Renderer specific attribute, the value specified here supercedes the one that would otherwise be rendered by the Renderer

]]>
name true java.lang.String
The value of the pass through attribute.

]]>
value true java.lang.Object
Add attributes to the passThroughAttributes Map of the UIComponent associated with the closest parent UIComponent tag. For each Map.Entry in the Map<String, Object> referenced by the value attribute of this tag, take the following action. Call component.getPassThroughAttributes().put(entry.getKey(), entry.getValue()).

]]>
passThroughAttributes com.sun.faces.facelets.tag.faces.core.PassThroughAttributesHandler An EL ValueExpression that evaluates to a Map<String, Object>.

]]>
value true java.util.Map
Register a PhaseListener instance on the UIViewRoot in which this tag is nested.

]]>
phaseListener com.sun.faces.facelets.tag.faces.core.PhaseListenerHandler Value binding expression that evaluates to an object that implements jakarta.faces.event.PhaseListener.

]]>
binding false jakarta.faces.event.PhaseListener
Fully qualified Java class name of a PhaseListener to be created and registered.

]]>
type false java.lang.String
Add a child UISelectItem component to the UIComponent associated with the closest parent UIComponent tag.

]]>
selectItem jakarta.faces.SelectItem Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this tag.

]]>
binding jakarta.faces.component.UIComponent
Component identifier of the UISelectItem component to be created.

]]>
id false java.lang.String
Description of this option, for use in development tools.

]]>
itemDescription java.lang.String
Flag indicating whether the option created by this component is disabled. Expressions must evaluate to a boolean. Default value is false.

]]>
itemDisabled java.lang.Boolean
Flag indicating that characters that are sensitive in the value of the itemLabel attribute must be escaped. This flag is set to "true" by default.

]]>
itemEscaped java.lang.String
Label to be displayed to the user for this option.

]]>
itemLabel java.lang.String
Value to be returned to the server if this option is selected by the user.

]]>
itemValue java.lang.String
Flag indicating whether the option created by this component represents the special "no selection" option. Expressions must evaluate to a boolean. Default value is false.

]]>
noSelectionOption java.lang.Boolean
Value binding expression pointing at a SelectItem instance containing the information for this option.

]]>
value jakarta.faces.model.SelectItem
Add a child UISelectItems component to the UIComponent associated with the closed parent UIComponent tag.

When iterating over the select items, toString() must be called on the string rendered attribute values.

Version 2 of the specification introduces several new attributes, described below. These are: var, itemValue, itemLabel, itemDescription, itemDisabled, and itemLabelEscaped.

]]>
selectItems jakarta.faces.SelectItems Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this tag.

]]>
binding jakarta.faces.component.UIComponent
id false java.lang.String evaluates to a String that will serve as the description to be shown for the item.

]]>
itemDescription java.lang.String
evaluates to a boolean that will determine if the item value is selectable or not.

]]>
itemDisabled java.lang.Boolean
evaluates to a String that will serve as the label to be shown for the item.

]]>
itemLabel java.lang.String
evaluates to a boolean that will determine if the rendered markup for the item receives normal Faces HTML escaping or not. If not specified, the runtime must behave as if the value were true.

]]>
itemLabelEscaped java.lang.Boolean
This attribute lets you refer to a property of the current member of the collection referenced by the "value" attribute, using the value of the "var" attribute as the base. For example, #{n.id}.

]]>
itemValue java.lang.Object
Is either an EL expression pointing to the element in the value collection whose value should be marked as a “no selection” item, or a literal string that exactly matches the value of the item in the collection that must be marked as the “no selection” item. If the user selects such an item and the field is marked as required, then it will not pass validation.

]]>
noSelectionValue java.lang.Boolean
Value expression pointing at any Collection or array. The member elements may be instances of SelectItem or any Java Object. In the case where the member elements are plain Java Objects, several additional attributes must be used by the page author to correctly identify the data to the enclosing UISelectOne or UISelectMany component, as shown in the following example.
  1. <h:selectOneListbox size="1" id="escape02" value="#{select05NoSelection.initialCollectionValues}">
  2.   <f:selectItems value="#{select05NoSelection.hobbitList}"
  3.                  var="n"
  4.                  itemValue="#{n.id}"
  5.                  itemLabel="#{n.bio}"
  6.                  itemDescription="#{n.description}"
  7.                  itemDisabled="#{n.disabled}"
  8.                  itemLabelEscaped="true"
  9.                  noSelectionValue="#{select05NoSelection.hobbitList[0]}"/>
  10. </h:selectOneListbox>

In the preceding example, the value attribute on line 1 points to a Collection<HobbitBean>. HobbitBean is just a regular Java Object (POJO) that conforms to JavaBeans naming conventions for its properties. The value attribute on line 2 points to a List<HobbitBean>, though it could just as well point to a Collection, array, or jakarta.faces.model.DataModel. The attributes on lines 3 through 9, inclusive, leverage the fact that the value is a collection of POJOs.

]]>
value java.lang.Object
Expose the value from the value attribute under this request scoped key so that it may be referred to in EL for the value of other attributes.

]]>
var false java.lang.String
UISelectItemGroup is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one SelectItemGroup of one or more SelectItem instances to the list of available options in the parent component. This component accepts only children of type UISelectItems or UISelectItem.

]]>
selectItemGroup jakarta.faces.SelectItemGroup UISelectItemGroup
component to be created. ]]> id java.lang.String UIComponent created by this tag. ]]> binding jakarta.faces.component.UIComponent itemLabel java.lang.String UISelectItemGroups is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one or more SelectItemGroup of one or more SelectItem instances to the list of available options in the parent component. This component accepts only children of type UISelectItems or UISelectItem.

]]>
selectItemGroups jakarta.faces.SelectItemGroups UISelectItemGroups component to be created. ]]> id java.lang.String UIComponent created by this tag. ]]> binding jakarta.faces.component.UIComponent Iterable. The member elements may be instances of any type which is acceptable by the value attribute of any nested UISelectItems or UISelectItem component. ]]> value java.lang.Object value attribute under this request scoped key, so that it may be referred to in EL for the value of other attributes of any nested component. ]]> var java.lang.String itemLabel java.lang.String boolean. Default value is false. ]]> itemDisabled java.lang.Boolean
Register an ActionListener instance on the UIComponent associated with the closest parent UIComponent tag. This actionListener will cause the value given by the "value" attribute to be set into the ValueExpression given by the "target" attribute.

The implementation of this tag creates a special ActionListener instance and registers it on the ActionSource associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag. This tag creates no output to the page currently being created.

The ActionListener instance created and installed by this tag has the following behavior and contract.

]]>
setPropertyActionListener com.sun.faces.facelets.tag.faces.core.SetPropertyActionListenerHandler If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
ValueExpression that is the destination of the value attribute.

]]>
target true java.lang.String
ValueExpression to be stored as the value of the target attribute.

]]>
value true java.lang.String
Naming Container tag for all Jakarta Faces core and component tags. It is particularly useful when a nested section included via <ui:include> or any tag that dynamically includes another page is included more than once, potentially causing duplicate component IDs. Each of those nested sections can then be wrapped in its own <f:subview> with each an unique id.

]]>
subview jakarta.faces.NamingContainer Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this tag.

]]>
binding jakarta.faces.component.UIComponent
Component identifier of the UINamingContainer component to be created.

]]>
id true java.lang.String
Flag indicating whether this component (and its children) should be rendered. Expressions must evaluate to a boolean.

]]>
rendered java.lang.Boolean

A validator that delegates the validation of the local value to the Bean Validation API. The validationGroups attribute serves as a filter that instructs the Bean Validation API which contraints to enforce. If there are any constraint violations reported by Bean Validation, the value is considered invalid. An instance of this validator can participate in class-level validation provided the preconditions mentioned in <f:validateWholeBean /> are met. Please see the documentation for <f:validateWholeBean /> and jakarta.faces.validator.BeanValidator.validate() for the specification and usage example.

]]>
validateBean jakarta.faces.Bean com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler A ValueExpression that evaluates to an instance of BeanValidator.

]]>
binding jakarta.faces.validator.BeanValidator
A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
A comma-separated list of validation groups. A validation group is a fully-qualified class name.

]]>
validationGroups false java.lang.String
Register a DoubleRangeValidator instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
validateDoubleRange jakarta.faces.DoubleRange com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler A ValueExpression that evaluates to an instance of DoubleRangeValidator.

]]>
binding jakarta.faces.validator.DoubleRangeValidator
A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Maximum value allowed for this component.

]]>
maximum java.lang.Double
Minimum value allowed for this component.

]]>
minimum java.lang.Double
Register a LengthValidator instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
validateLength jakarta.faces.Length com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler A ValueExpression that evaluates to an instance of LengthValidator.

]]>
binding jakarta.faces.validator.LengthValidator
A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Maximum length allowed for this component.

]]>
maximum java.lang.Integer
Minimum length allowed for this component.

]]>
minimum java.lang.Integer
Register a LongRangeValidator instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
validateLongRange jakarta.faces.LongRange com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler binding jakarta.faces.validator.LongRangeValidator A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Maximum value allowed for this component.

]]>
maximum java.lang.Long
Minimum value allowed for this component.

]]>
minimum java.lang.Long
A validator that uses the pattern attribute to validate the wrapping component. The entire pattern is matched against the String value of the component. If it matches, it's valid.

]]>
validateRegex jakarta.faces.RegularExpression com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler A ValueExpression that evaluates to an instance of RegexValidator.

]]>
binding jakarta.faces.validator.RegexValidator
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
A regular expression pattern. Remember that, like in all Java strings, backslash must be escaped with another backslash.

]]>
pattern true java.lang.String
A validator that enforces the presence of a value. It has the same affect as setting the required attribute on a UIInput to true.

]]>
validateRequired jakarta.faces.Required com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler binding jakarta.faces.validator.RequiredValidator A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Support multi-field validation by enabling class-level bean validation on CDI based backing beans. This feature causes a temporary copy of the bean referenced by the value attribute, for the sole purpose of populating the bean with field values already validated by <f:validateBean /> and then performing class-level validation on the copy. Regardless of the result of the class-level validation, the copy is discarded. This feature must explicitly be enabled by setting the application parameter specified in the javadoc for the symbolic constant jakarta.faces.validator.BeanValidator.ENABLE_VALIDATE_WHOLE_BEAN_PARAM_NAME. If this parameter is not set, or is set to false, this tag must be a no-op. A non-normative example follows the specification of the feature.

At a high level, the feature provides for a UIInput subclass that maintains its own special private Validator that uses information from one or more <f:validateBean />s to perform class-level bean validation. For discussion, this special Validator is called the wholeBeanValidator.

This tag must be backed by a UIInput component with the following specializations.

  • Override getSubmittedValue() to return a non-null non empty String. This allows UIInput.validate() to call wholeBeanValidator.validate().

  • Override setConverter() to be a no-op. It does not make sense to allow a converter to be installed.

  • Override addValidator() to be a no-op unless the argument is an instance of wholeBeanValidator. It does not make sense to allow additional validators to be installed.

  • Override validate() to take the following actions.

    • If the feature is not enabled, return immediately.

    • If the wholeBeanValidator has not yet been installed, instantiate and pass it to this.addValidator().

    • Call super.validate().

The wholeBeanValidator must have a validate() method that performs the following actions. Due to the above specification, this method will only ever be passed the special UIInput component.

    Resolve the value of the component to its Object. Assume that this value is the bean whose properties are intended to be populated by components whose values are each validated by <f:validateBean /> tags. For discussion, this bean is called the candidate bean and the properties and their respective values are called the candidate values. If the candidate bean cannot be referenced, return immediately from validate(). Use the information recorded by each of those <f:validateBean /> tags to ensure that none of the candidate values are invalid. If any of them are invalid, return immediately from validate(). This ensures class-level validation is only performed on an instance whose fields are all individually valid.

    Otherwise it can be assumed that all field-level validations for this class-level validation have passed.

    Class-level bean validation must operate on a sufficiently populated bean instance. This differs from Faces field-level validation, which prevents beans from being populated with invalid values. To accomodate this difference, the candidate bean must be copied, populated with the already-validated candidate values, and then subjected to class-level validation. The copying must proceed in the following order.

    1. Invoke the newInstance() method on the bean's Class. If this throws any Exception, swallow it and continue.

    2. If the bean implements Serializable, use that to copy the bean instance.

    3. Otherwise, if the bean implements Cloneable, clone the bean instance.

    4. Otherwise, if the bean has a copy constructor, use that to copy the bean instance.

    5. If none of these techniques yields a copy, throw FacesException.

    Populate the copied bean with the candidate values.

    Obtain a reference to a jakarta.validation.Validator instance using the same steps described in the javadoc for jakarta.faces.validator.BeanValidator.validate(). Let the instance be called beanValidator for discussion.

    Obtain the value of the validationGroups attribute using the same steps described in the javadoc for jakarta.faces.validator.BeanValidator.validate(). If this value is not present or not valid, throw FacesException.

    Call the validate method on beanValidator, passing the populated copied bean and the validation groups as arguments. The copied bean can be discarded at this point.

    If the returned Set<ConstraintViolation> is non-empty, for each element in the Set, create a FacesMessage where the summary and detail are the return from calling ConstraintViolation.getMessage(). Capture all such FacesMessage instances into a Collection and pass them to ValidatorException. Using information recorded by the <f:validateBean /> tag(s), call setValid(false) on all of the components whose values contributed to this class-level validation. This is essential to prevent the invalid value from being set into the model during the update model values phase. Finally, throw the exception.

This tag must be placed in the component tree after all of the fields that are to be included in the multi-field validation. If this precondition is not met, the results of applying this tag are unspecified.

This tag must be used in concert with <f:validateBean /> and Bean Validation. Here is a brief example of the common case of ensuring two password fields are individually valid and also both the same. The feature requires the use of the validationGroups attribute on all of the <f:validateBean /> tags and the <f:validateWholeBean /> tag.

First, the ConstraintValidator implementation.


public class PasswordValidator implements ConstraintValidator<Password, PasswordHolder> {

  @Override
  public void initialize(Password constraintAnnotation) { }

  @Override
  public boolean isValid(PasswordHolder value, ConstraintValidatorContext context) {
    boolean result;
    
    result = value.getPassword1().equals(value.getPassword2());

    return result;
  }

}

Note that a PasswordHolder instance is passed to the isValid() method. This method will only be called if the individual properties of the PasswordHolder are valid. This fact allows the isValid() method to inspect the properties and perform effective class-level validtion.

Next, the Constraint.


@Constraint(validatedBy=PasswordValidator.class)
@Target(TYPE)
@Retention(RUNTIME)
@interface Password {

    String message() default "Password fields must match";
    Class[] groups() default {};
    Class[] payload() default {};
}

Now the backing bean constrained by this Constraint. Note the use of groups. Note the fact that the bean implements Cloneable.


@Named
@RequestScoped
@Password(groups = PasswordValidationGroup.class)
public class BackingBean implements PasswordHolder, Cloneable {
    
    private String password1;
    
    private String password2;

    public BackingBean() {
        password1="";
        password2="";
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        BackingBean other = (BackingBean) super.clone();
        other.setPassword1(this.getPassword1());
        other.setPassword2(this.getPassword2());
        return other;
    }
    
    @NotNull(groups=PasswordValidationGroup.class)
    @Size(max=16, min=8, message="Password must be between 8 and 16 characters long",
            groups = PasswordValidationGroup.class)
    @Override
    public String getPassword1() {
        return password1;
    }

    public void setPassword1(String password1) {
        this.password1 = password1;
    }

    @NotNull(groups=PasswordValidationGroup.class)
    @Size(max=16, min=8, message="Password must be between 8 and 16 characters long",
            groups = PasswordValidationGroup.class)
    @Override
    public String getPassword2() {
        return password2;
    }

    public void setPassword2(String password2) {
        this.password2 = password2;
    }
    
}

Finally, the Facelets view.


<h:panelGrid columns="2">

    <h:outputText value="Password" />  
    <h:inputSecret id="password1" value='#{backingBean.password1}'>
        <f:validateBean validationGroups="PasswordValidationGroup" />
    </h:inputSecret>
    
    <h:outputText value="Password again" /> 
    <h:inputSecret id="password2" value='#{backingBean.password2}'>
        <f:validateBean validationGroups="PasswordValidationGroup" />
    </h:inputSecret>
    
</h:panelGrid>

<f:validateWholeBean value='#{backingBean}' 
   validationGroups="PasswordValidationGroup" />
]]>
validateWholeBean com.sun.faces.ext.validateWholeBean A boolean value enabling or disabling this validation component.

]]>
disabled false java.lang.Boolean
Component identifier of the UIInput component to be created.

]]>
id false java.lang.String
A comma-separated list of validation groups. A validation group is a fully-qualified class name.

]]>
validationGroups true java.lang.String
A ValueExpression referencing the bean to be validated.

]]>
value true java.lang.Object
Register a named Validator instance on the UIComponent associated with the closest parent UIComponent tag.

Usage outside of an EditableValueHolder parent

If this element is nested within a UIComponent tag that has other UIComponent children, the validator will be automatically added to all the child components as well as this one. The implementation must ensure this occurs even if the parent of this element is not an instance of EditableValueHolder.

]]>
validator com.sun.faces.facelets.tag.faces.core.ValidateDelegateHandler A ValueExpression that evaluates to an object that implements the jakarta.faces.validator.Validator interface.

]]>
binding jakarta.faces.validator.Validator
A boolean value enabling page level determination of whether or not this validator is enabled on the enclosing component.

]]>
disabled java.lang.Boolean
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Validator identifier of the Validator to be created and registered.

]]>
validatorId java.lang.String
Register a ValueChangeListener instance on the UIComponent associated with the closest parent UIComponent tag.

]]>
valueChangeListener com.sun.faces.facelets.tag.faces.core.ValueChangeListenerHandler Value binding expression that evaluates to an object that implements jakarta.faces.event.ValueChangeListener.

]]>
binding false jakarta.faces.event.ValueChangeListener
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
Fully qualified Java class name of a ValueChangeListener to be created and registered.

]]>
type java.lang.String
Container for all Jakarta Faces core and component tags used on a page.

]]>
view jakarta.faces.ViewRoot MethodBinding pointing to a method that takes a jakarta.faces.event.PhaseEvent and returns void. This method will be called after every phase except for restore view on an initial request.

]]>
afterPhase false void afterPhase(jakarta.faces.event.PhaseEvent)
MethodBinding pointing to a method that takes a jakarta.faces.event.PhaseEvent and returns void. This method will be called before every phase except for restore view.

]]>
beforePhase false void beforePhase(jakarta.faces.event.PhaseEvent)
Specifies the content-type of the response.

]]>
contentType false java.lang.String
A comma separated list of resource library contracts that may be used from within the Facelets chain. If this attribute is present, it must only be on the outer-most file in the chain of files that started ultimately with a call to ViewDeclarationLanguage.createView(). Any use of this attribute on a non-outer-most file is undefined.

If this attribute exists on the tag, empty or not, the tag handler must create a List<String> for the value of the attribute and unconditionally call FacesContext.setRresourceLibraryContracts() passing that list value.

]]>
contracts false java.lang.String
Specifies the character encoding that should be used for the response.

]]>
encoding false java.lang.String
Locale to use for localizing this page. Expressions must evaluate to a java.util.Locale or to a String that is converted to a Locale.

]]>
locale java.lang.Object
renderKitId false java.lang.String If true, this view must not participate in state saving or restoring. Note that transient views may not be used with @ViewScoped managed beans. The implementation must call setTransient() on the UIViewRoot, passing the value of the attribute as specified in the markup.

]]>
transient false java.lang.Boolean
This action component specifies an application-specific command (or action), using an EL method expression, to be invoked during one of the Faces lifecycle phases, by default Invoke Application.

]]>
viewAction jakarta.faces.ViewAction MethodExpression representing the application action to invoke when this component is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns an Object (the toString() of which is called to derive the logical outcome) which is passed to the NavigationHandler for this application.

]]>
action true public java.lang.Object action()
MethodExpression representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void, or to a public method that takes no arguments with a return type of void. In the latter case, the method has no way of easily knowing where the event came from, but this can be useful in cases where a notification is needed that "some action happened".

]]>
actionListener false public void actionListener(jakarta.faces.event.ActionEvent)
Flag indicating that, if this component is activated by the user, notifications should be delivered to interested listeners and actions immediately (that is, during Apply Request Values phase) rather than waiting until Invoke Application phase.

]]>
immediate false java.lang.Boolean
View actions are most commonly used on the initial view request. Therefore, view actions do not operate on postback, by default. This attribute enables a view action to operate on postback.

]]>
onPostback false java.lang.Boolean
Specifies the phase in which the action invocation should occur using the name of the phase constant in the PhaseId class (the case does not matter). The value must be one of APPLY_REQUEST_VALUES, PROCESS_VALIDATIONS, UPDATE_MODEL_VALUES, or INVOKE_APPLICATION. The default is INVOKE_APPLICATION.

]]>
phase false java.lang.String
Like all children of <f:metadata>, a view action has no visual representation in the view. This attribute has exactly the same effect on a view action as the rendered attribute has on a visual component. Specifically, if the value of this attribute evaluates to false the component has no effect.

]]>
rendered false java.lang.Boolean
Used inside of the metadata facet of a view, this tag causes a UIViewParameter to be attached as metadata for the current view. Because UIViewParameter extends UIInput all of the attributes and nested child content for any UIInput tags are valid on this tag as well.

]]>
viewParam jakarta.faces.Parameter The ValueExpression linking this component to a property in a backing bean.

]]>
binding false jakarta.faces.component.UIComponent
Converter instance registered with this component.

]]>
converter false jakarta.faces.convert.Converter
A ValueExpression enabled attribute that, if present, will be used as the text of the converter message, replacing any message that comes from the converter.

]]>
converterMessage false java.lang.String
If present, this attribute refers to the value of one of the exposed attached objects within the composite component inside of which this tag is nested.

]]>
for false java.lang.String
The component identifier for this component. This value must be unique within the closest parent component that is a naming container.

]]>
id false java.lang.String
The name of the request parameter from which the value for this component is retrieved on an initial request or to override the stored value on a postback.

]]>
name true java.lang.String
Flag indicating that the user is required to provide a submitted value for this input component.

]]>
required false boolean
A ValueExpression enabled attribute that, if present, will be used as the text of the validation message for the "required" facility, if the "required" facility is used.

]]>
requiredMessage false java.lang.String
MethodExpression representing a validator method that will be called during Process Validations to perform correctness checks on the value of this component. The expression must evaluate to a public method that takes FacesContext, UIComponent, and Object parameters, with a return type of void.

]]>
validator false void validate(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent, java.lang.Object)
A ValueExpression enabled attribute that, if present, will be used as the text of the validator message, replacing any message that comes from the validator.

]]>
validatorMessage false java.lang.String
A ValueExpression to which the value of the request parameter, as determined by the name attribute, is bound. The resolved value of this expression is used when encoding the view parameter into a bookmarkable link or redirect URL with view parameter encoding enabled. If this attribute is omitted, the value of the request parameter will instead be the local value of the UIViewParameter.

]]>
value false java.lang.Object
MethodExpression representing a value change listener method that will be notified when a new value has been set for this input component. The expression must evaluate to a public method that takes a ValueChangeEvent parameter, with a return type of void, or to a public method that takes no arguments with a return type of void. In the latter case, the method has no way of easily knowing what the new value is, but this can be useful in cases where a notification is needed that "this value changed".

]]>
valueChangeListener false void valueChange(jakarta.faces.event.ValueChangeEvent)
maxlength false int
Registers a websocket push connection in client side by rendering the necessary scripts. Push messages can be sent from server side via jakarta.faces.push.PushContext interface. See also jakarta.faces.push.Push API documentation for an elaborate instruction on how to use <f:websocket>.

]]>
websocket jakarta.faces.Websocket Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this tag.

]]>
binding false jakarta.faces.component.UIComponent
Component identifier of the UIWebsocket component to be created.

]]>
id false java.lang.String
The name of the websocket channel. It may not be an EL expression and it may only contain alphanumeric characters, hyphens, underscores and periods. All open websockets on the same channel name will receive the same push notification from the server.

]]>
channel true java.lang.String
The scope of the websocket channel. It may not be an EL expression and allowed values are application, session and view, case insensitive. When the value is application, then all channels with the same name throughout the application will receive the same push message. When the value is session, then only the channels with the same name in the current user session will receive the same push message. When the value is view, then only the channel in the current view will receive the push message. The default scope is application. When the user attribute is specified, then the default scope is session.

]]>
scope false java.lang.String
The user identifier of the websocket channel, so that user-targeted push messages can be sent. It must implement Serializable and preferably have low memory footprint. Suggestion: use #{request.remoteUser} or #{someLoggedInUser.id}. All open websockets on the same channel and user will receive the same push message from the server.

]]>
user false java.io.Serializable
The JavaScript event handler function that is invoked when the websocket is opened. The function will be invoked with one argument: the channel name.

]]>
onopen false java.lang.String
The JavaScript event handler function that is invoked when a push message is received from the server. The function will be invoked with three arguments: the push message, the channel name and the raw MessageEvent itself.

]]>
onmessage false java.lang.String
The JavaScript event handler function that is invoked when a connection error has occurred and the websocket will attempt to reconnect. The function will be invoked with three arguments: the error reason code, the channel name and the raw CloseEvent itself. Note that this will not be invoked on final close of the websocket, even when the final close is caused by an error. See also RFC 6455 section 7.4.1 and CloseCodes API for an elaborate list of all close codes.

]]>
onerror false java.lang.String
The JavaScript event handler function that is invoked when the websocket is closed and will not anymore attempt to reconnect. The function will be invoked with three arguments: the close reason code, the channel name and the raw CloseEvent itself. Note that this will also be invoked when the close is caused by an error and that you can inspect the close reason code if an actual connection error occurred and which one (i.e. when the code is not 1000 or 1008). See also RFC 6455 section 7.4.1 and CloseCodes API for an elaborate list of all close codes.

]]>
onclose false java.lang.String
Whether to (auto)connect the websocket or not. Defaults to true. It's interpreted as a JavaScript instruction whether to open or close the websocket push connection. This attribute is implicitly re-evaluated on every ajax request by a PreRenderViewEvent listener on the UIViewRoot. You can also explicitly set it to false and then manually control in JavaScript by faces.push.open(clientId) and faces.push.close(clientId).

]]>
connected false java.lang.Boolean
Whether to render the websocket scripts or not. Defaults to true. This attribute is implicitly re-evaluated on every ajax request by a PreRenderViewEvent listener on the UIViewRoot. If the value changes to false while the websocket is already opened, then the websocket will implicitly be closed.

]]>
rendered false java.lang.Boolean




© 2015 - 2024 Weber Informatics LLC | Privacy Policy