myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <>
Subject Re: Is it possible to use multiple resource bundles with JSF?
Date Wed, 03 Jan 2007 21:19:12 GMT
On 1/3/07, mraible <> wrote:
> Is it possible to use multiple i18n resource bundles with JSF? I'd like to
> have a for labels, messages and such and an
> for validation errors. I'd be happy to move to JSF 1.2if
> that's a feature not present in 1.1.

In JSP syntax:

    <f:loadBundle var="labels" bundleName="com.mycompany.MyLabelsBundle"/>
    <f:loadBundle var="errors" bundleName="com.mycompany.MyErrorsBundle"/>
    <h:outputLabel for="username" value="#{labels['username.label'}"/>
    <h:outputText value="#{errors['error.key']}"/>

For Facelets or Clay, use the corresponding equivalent to loadBundle to load
multiple individual bundles.

The only restriction is that JSF itself accepts only one resource bundle
name in which to look up replacements for the standard conversion and
validation error messages (section 2.5.2 in the JSF spec).

> Matt


View raw message