Hi Lana.
Some weeks ago I had the same questions you're having now. Then, I just took a look at the "countries" application, which is in the "samples" folder of "springframewor with dependencies". That application helped me so much.
But, in case you don't have time to study that application, I'll try to give you some tips, that, I hope, may be helpful.
When thinking about spring multi-language applications, besides the "ResourceBundleMessageSource", you also must have a "ResourceBundleViewResolver". You must declare this bean in the applicationContext.xml, setting its "basenames" property. This property refers to a simple properties file, which defines some properties of the view that is being resolved.
Code:
<bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<property name="basename"><value>your_properties_file</value></property>
Properties file example:
Code:
modelView.class=org.springframework.web.servlet.view.JstlView
modelView.url=/WEB-INF/views/jsp/countries/model.jsp
Well, besides that, you must have a localeResolver bean declared in your appcontext, just like that:
Code:
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
And a locale change interceptor:
Code:
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"/>
After that, you have to declar a "interceptors" property in your urlMapping bean, like this:
Code:
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref local="localeChangeInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
...
Basically, these are the steps to be followed.
One more thing only: For changing your application's language during its runtime, all you have to do is set a "locale" attribute in some request. Something like that:
Code:
<jsp:forward page="/urlToBeResoved.html?locale=en_US"/>
I hope I could help you.
Mauricio