Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to configure resource bundle in facescontext.xml in JSF

843844Oct 7 2008 — edited Mar 11 2009
Hi,

How to switch different resource bundles depend on different locales in JSF page.........
here is my code......

faces-config.xml
...........
<application>
        <message-bundle>rbundles.Administration</message-bundle>
        <locale-config>
            <default-locale>en_UK</default-locale>
            <supported-locale>ar_SA</supported-locale>
            <supported-locale>en-US</supported-locale>
        </locale-config>
    </application>
.......
jsp page
<f:view>
            <f:loadBundle basename="Administration" var="rb"/>
            <h:form id="pc">
.........
.........
</f:view>
browser locale is en_US, and my resourse bundle package structure is
rbundles.Administration.properties
rbundles.Administration_en_US.properties
rbundles.Administration_ar_SA.properties

so, at the run time i am getting this exception.......
java.util.MissingResourceException: Can't find bundle for base name Administration, locale en_US
	java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1508)
	java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1262)
	java.util.ResourceBundle.getBundle(ResourceBundle.java:964)
	com.sun.faces.taglib.jsf_core.LoadBundleTag.doStartTag(LoadBundleTag.java:146)
........................
.......................
so what was the problem in my configuration, please help me.......
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2009
Added on Oct 7 2008
5 comments
909 views