change locale not working - please help me
Hi all,
I'm trying to develop a multilanguage web application, I found the instruction to change the language at this link
Chapter*13.*Web MVC framework
and I have only add this code on my dispatcher-servlet :
Code:
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="siteLanguage"/>
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref bean="localeChangeInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
<prop key="login.htm">indexController</prop>
<prop key="uploadfile.htm">fileUploadController</prop>
<prop key="successUpload.htm">successUploadController</prop>
</props>
</property>
</bean>
and I try to change the language with this link : index.htm?siteLanguage=en_EN
but is not working.
Please help me....
Re: change locale not working - please help me
What does "it's not working" mean? What do you expect to happen? What happens instead?
Re: change locale not working - please help me
With the link index.htm?siteLanguage=en_EN i want to change the language of the page, but nothing happen when i load this url.
Re: change locale not working - please help me
Um, I don't think there's a way to just change the language like that. Locale != language. Changing the language there does not magically change the text on the page, it just changes what language the browser thinks is being displayed, which doesn't really do much for you.
Re: change locale not working - please help me
I have a file properties with the label that I want to change the language, one properties for each language.
If I modify the language of the browser, it also change the language of my page, but I want to change language with a link on the page or somethings like this.
PS: I'm sorry for my poor English...
Re: change locale not working - please help me
I have the same problem.
The servlet xml succeed to load the message_en.properties
But the language was not changed by changing the url language parameter
I know that this work for some controllers (I have checked out localespring1 sample) but in my application the change of language do not take place.
Re: change locale not working - please help me
I've resolved the issue with a filter in my web.xml.
You can see it in appfuse(appfuse.org).