type=page
status=published
title=Using Core Tags
next=jsf-page-core.html
prev=jsf-page002.html
~~~~~~
= Using Core Tags


[[BNARC]]

[[using-core-tags]]
Using Core Tags
---------------

The tags included in the JavaServer Faces core tag library are used to
perform core actions that are not performed by HTML tags.

link:#GKVYB[Table 10-8] lists the event-handling core tags.

[[sthref53]][[GKVYB]]

*Table 10-8 Event-Handling Core Tags*

[width="99%",cols="30%,70%"]
|=======================================================================
|*Tag* |*Function*
|`f:actionListener` |Adds an action listener to a parent component

|`f:phaseListener` |Adds a `PhaseListener` to a page

|`f:setPropertyActionListener` |Registers a special action listener
whose sole purpose is to push a value into a managed bean when a form is
submitted

|`f:valueChangeListener` |Adds a value-change listener to a parent
component
|=======================================================================


link:#GKVYY[Table 10-9] lists the data-conversion core tags.

[[sthref54]][[GKVYY]]

*Table 10-9 Data-Conversion Core Tags*

[width="99%",cols="30%,70%"]
|=======================================================================
|*Tag* |*Function*
|`f:converter` |Adds an arbitrary converter to the parent component

|`f:convertDateTime` |Adds a `DateTimeConverter` instance to the parent
component

|`f:convertNumber` |Adds a `NumberConverter` instance to the parent
component
|=======================================================================


link:#GKVZG[Table 10-10] lists the facet core tags.

[[sthref55]][[GKVZG]]

*Table 10-10 Facet Core Tags*

[width="99%",cols="30%,70%"]
|=======================================================================
|*Tag* |*Function*
|`f:facet` |Adds a nested component that has a special relationship to
its enclosing tag

|`f:metadata` |Registers a `facet` on a parent component
|=======================================================================


link:#GKVZA[Table 10-11] lists the core tags that represent items in a
list.

[[sthref56]][[GKVZA]]

*Table 10-11 Core Tags That Represent Items in a List*

[width="99%",cols="30%,70%"]
|======================================================
|*Tag* |*Function*
|`f:selectItem` |Represents one item in a list of items
|`f:selectItems` |Represents a set of items
|======================================================


link:#GKVYV[Table 10-12] lists the validator core tags.

[[sthref57]][[GKVYV]]

*Table 10-12 Validator Core Tags*

[width="99%",cols="30%,70%"]
|=======================================================================
|*Tag* |*Function*
|`f:validateDoubleRange` |Adds a `DoubleRangeValidator` to a component

|`f:validateLength` |Adds a `LengthValidator` to a component

|`f:validateLongRange` |Adds a `LongRangeValidator` to a component

|`f:validator` |Adds a custom validator to a component

|`f:validateRegEx` |Adds a `RegExValidator` to a component

|`f:validateBean` |Delegates the validation of a local value to a
`BeanValidator`

|`f:validateRequired` |Enforces the presence of a value in a component
|=======================================================================


link:#GKVYU[Table 10-13] lists the core tags that fall into other
categories.

[[sthref58]][[GKVYU]]

*Table 10-13 Miscellaneous Core Tags*

[width="99%",cols="25%,15%,60%"]
|=======================================================================
|*Tag Category* |*Tag* |*Function*
|Attribute configuration |`f:attribute` |Adds configurable attributes to
a parent component

|Localization |`f:loadBundle` |Specifies a `ResourceBundle` that is
exposed as a `Map`

|Parameter substitution |`f:param` |Substitutes parameters into a
`MessageFormat` instance and adds query string name-value pairs to a URL

|Ajax |`f:ajax` |Associates an Ajax action with a single component or a
group of components based on placement

|Event |`f:event` |Allows installing a `ComponentSystemEventListener` on
a component

|WebSocket |`f:websocket` |Allows server-side communications to be
pushed to all instances of a socket containing the same channel name.
|=======================================================================


These tags, which are used in conjunction with component tags, are
explained in other sections of this tutorial.

link:#BNARE[Table 10-14] lists the sections that explain how to use
specific core tags.

[[sthref59]][[BNARE]]

*Table 10-14 Where the Core Tags Are Explained*

[width="99%",cols="30%,70%"]
|=======================================================================
|*Tags* |*Where Explained*
|Event-handling tags a|
link:jsf-page-core002.html#BNASZ[Registering Listeners on Components]


|Data-conversion tags a|
link:jsf-page-core001.html#BNAST[Using the Standard Converters]


|`f:facet` |link:jsf-page002.html#BNARZ[Using Data-Bound Table
Components] and link:jsf-page002.html#BNASC[Laying Out Components with
the h:panelGrid and h:panelGroup Tags]

|`f:loadBundle` a|
link:webi18n002.html#BNAXY[Setting the Resource Bundle]


|`f:metadata` a|
link:jsf-page002.html#GIQWQ[Using View Parameters to Configure
Bookmarkable URLs]


|`f:param` a|
link:jsf-page002.html#BNARU[Displaying a Formatted Message with the
h:outputFormat Tag]


|`f:selectItem` and `f:selectItems` a|
link:jsf-page002.html#BNASK[Using the f:selectItem and f:selectItems
Tags]


|Validator tags |link:jsf-page-core003.html#BNATC[Using the Standard
Validators]

|`f:ajax` a|
link:jsf-ajax.html#GKIOW[Chapter 13, "Using Ajax with JavaServer Faces
Technology"]

|`f:websocket` a|
link:jsf-ws.html#using-websockets-with-javaserver-faces-technology[Chapter 17, "Using WebSockets with JavaServer Faces Technology"]


|=======================================================================
