In a web application written using spring-MVC, I want to allow users to change the current language by clicking on a link which text is the name of the language.
I have already set up a messageSource and made all my jsp pages find the messages using this messageSource. Currently, the language is changing depending on the locale of the user browser.
So, what I want to do now is to allow to change the locale manually.
I have found that the class SessionLocaleResolver could help, but I do not know how to set it up in my application context file (which name is myAppName-servlet.xml) .
I have defined the bean :
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
</bean>
But in which bean should I plug this ? Furthermore, how do I set a cookie related to locale into an user session ?