Currently my team is developing a web 2.0 application in java and we are using JSF for the presentation layer. We are beginning with the presentation layer so we have yet to add the business and data layer.
Technologies we use: - JSF (Mojarra 2.0.3) - Primefaces 2.1 (JSF library of components) - Spring Security 3.0.5 - jBoss 5.1
I was asked to add locale support to the app. So I configured the faces-config.xml file as follows:
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>pt</supported-locale>
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<message-bundle>
com.<company>.<product>.i18n.MessageBundle
</message-bundle>
</application>
I created the MessageBundle suffixed files and deployed the app. I read that there are 3 criteria that JSF uses to choose the locale: 1) match between request locales (Accept-Language request header) and the supported locales 2) application default locale defined in the faces config file 3) JVM default locale
When I try to change the language in my browser options the app does not change the locale. Even if I only configure one language other than the default one. Am I missing something here? Is this what to expect or in fact it should change contents when I change the browser language (provided it is a supported language)?
I would very much appreciate any tips or at least a pointer as to where I could find the answer seen as I have googled already for it with no luck.
Thanks in advance.