Hello everyone,
I'm building an application with the initial configuration based on the booking-faces.
I managed to configure the resource bundle correctly. The problem is: no matter what I do the LocaleChangeInterceptor doesn't intercept my request, or at least my debugger doesn't show it, and indeed the locale doesn't change.
This the relevant bit of my configuration:
../resources/messages.properties
../resources/messages_pt.properties
webmvc-config.xml:
faces-config.xml: (where MySpringBeanFacesELResolver is exactly as ivats.)Code:<bean id="msgSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" p:basename="classpath:messages"/> <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" /> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" />
Code:<application> <el-resolver>pt.m24.portal.utils.MySpringBeanFacesELResolver</el-resolver> <locale-config> <default-locale>en</default-locale> <supported-locale>pt</supported-locale> </locale-config> <resource-bundle> <base-name>messages</base-name> <var>msg</var> </resource-bundle> </application>
main.xhtml: (the bit of the file where I want to change locale)
Can anyone please point me in the right direction.Code:<h:outputLink id="enLocaleUrl" value="/app/welcome" > <f:param name="locale" value="" /> <h:outputLabel value="#{msgSource.locale_english}"/> </h:outputLink> <h:outputLink id="ptLocaleUrl" value="/app/welcome" > <f:param name="locale" value="pt" /> <h:outputLabel value="#{msgSource.locale_portuguese}"/> </h:outputLink>
Thank you in advance.


Reply With Quote
