10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ Your shopping cart contains {0} items.<br />

<strong>The</strong> value of the parameter replaces the {0} from the message in the sentence in the third bullet.<br />

This is an example of a value-expression-enabled tag attribute accepting a complex EL<br />

expression.<br />

An outputFormat tag can include more than one param tag for those messages that have more<br />

than one parameter that must be concatenated into the message. If you have more than one<br />

parameter for one message, make sure that you put the param tags in the proper order so that<br />

the data is inserted in the correct place in the message.<br />

A page author can also hard code the data to be substituted in the message by using a literal<br />

value with the value attribute on the param tag.<br />

Rendering a Password Field with the inputSecret Tag<br />

<strong>The</strong> inputSecret tag renders an HTML tag. When the user types a<br />

string into this field, a row of asterisks is displayed instead of the text the user types. <strong>The</strong> Duke’s<br />

Bookstore application does not include this tag, but here is an example of one:<br />

<br />

Adding UI Components to a Page Using the HTML ComponentTags<br />

In this example, the redisplay attribute is set to false. This will prevent the password from<br />

being displayed in a query string or in the source file of the resulting HTML page.<br />

Using Command Components for Performing Actions<br />

and Navigation<br />

<strong>The</strong> button and hyperlink components are used to perform and action, such as submitting a<br />

form, and for navigating to another page.<br />

Command components in <strong>Java</strong>Server Faces applications are represented by the UICommand<br />

component, which performs an action when it is activated. <strong>The</strong> UICommand component<br />

supports two renderers: Button and Link as UICommand component renderers.<br />

<strong>The</strong> commandButton tag represents the combination of a UICommand component and a Button<br />

renderer and is rendered as a button. <strong>The</strong> commandLink tag represents the combination of a<br />

UICommand component and a Link renderer and is rendered as a hyperlink.<br />

Chapter 11 • Using <strong>Java</strong>Server FacesTechnology in JSP Pages 333

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!