background image

The inputSecret Tag

<< The outputLink Tag | The commandButton Tag >>
<< The outputLink Tag | The commandButton Tag >>

The inputSecret Tag

Your shopping cart contains {0} items.
The value of the parameter replaces the {0} from the message in the sentence in the third bullet.
This is an example of a value-expression-enabled tag attribute accepting a complex EL
expression.
An outputFormat tag can include more than one param tag for those messages that have more
than one parameter that must be concatenated into the message. If you have more than one
parameter for one message, make sure that you put the param tags in the proper order so that
the data is inserted in the correct place in the message.
A page author can also hard code the data to be substituted in the message by using a literal
value with the value attribute on the param tag.
Rendering a Password Field with the inputSecret Tag
The inputSecret tag renders an <input type="password"> HTML tag. When the user types a
string into this field, a row of asterisks is displayed instead of the text the user types. The Duke's
Bookstore application does not include this tag, but here is an example of one:
<h:inputSecret redisplay=
"false"
value=
"#{LoginBean.password}" />
In this example, the redisplay attribute is set to false. This will prevent the password from
being displayed in a query string or in the source file of the resulting HTML page.
Using Command Components for Performing Actions
and Navigation
The button and hyperlink components are used to perform and action, such as submitting a
form, and for navigating to another page.
Command components in JavaServer Faces applications are represented by the UICommand
component, which performs an action when it is activated. The UICommand component
supports two renderers: Button and Link as UICommand component renderers.
The commandButton tag represents the combination of a UICommand component and a Button
renderer and is rendered as a button. The commandLink tag represents the combination of a
UICommand
component and a Link renderer and is rendered as a hyperlink.
Adding UI Components to a Page Using the HTML Component Tags
Chapter 11 · Using JavaServer Faces Technology in JSP Pages
335