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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

...<br />

<br />

<br />

com.sun.bookstore6.resources.CustomMessages<br />

<br />

customMessages<br />

<br />

...<br />

<br />

Similarly to the loadBundle tag, the value of the base-name subelement specifies the<br />

fully-qualified class name of the ResourceBundle class, which in this case is located in the<br />

resources package of the application.<br />

Also similarly to the var attribute of the loadBundle tag, the var subelement of the<br />

resource-bundle element is an alias to the ResourceBundle class. This alias is used by tags in<br />

the page to identify the resource bundle.<br />

<strong>The</strong> locale-config element shown in the previous section also applies to the messages and<br />

static text identified by the resource-bundle element. As with resource bundles identified by<br />

the message-bundle element, make sure that the resource bundle identified by the<br />

resource-bundle element actually contains the messages for the locales that you specify with<br />

these locale-config elements.<br />

To access the localized message, the page author uses a value expression to reference the key of<br />

the message from the resource bundle. See “Performing Localization” on page 388 for more<br />

information.<br />

Registering a CustomValidator<br />

If the application developer provides an implementation of the Validator interface to perform<br />

validation, you must register this custom validator in the application configuration resource file<br />

by using the validator XML element:<br />

<br />

...<br />

FormatValidator<br />

<br />

com.sun.bookstore6.validators.FormatValidator<br />

<br />

<br />

...<br />

formatPatterns<br />

java.lang.String<br />

<br />

<br />

Registering a CustomValidator<br />

Chapter 14 • Configuring <strong>Java</strong>Server Faces Applications 447

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

Saved successfully!

Ooh no, something went wrong!