-
Jun 30th, 2009, 01:14 PM
#1
how to pass add parameter to URL from Controller to specify locale
Hi,
I have requirement to implement Locale ability to website. I have configure my servlet-spring.xml such as
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor">
<property name="paramName" value="siteLanguage"/>
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.Sessio nLocaleResolver" />
<bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
<property name="basename" value="locale"/>
</bean>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref local="localeChangeInterceptor"/>
</list>
</property>
</bean>
I have resource file name as locale.properties and locale_fr.properties.
Spring is able to find the locale and replace my JSP fmt tages. but I have explicitly add parameter siteLanguage=fr to URL.
Is there any way to pass or bind this parameter in URL from controller because my language code like "fr, sv" is comes from database based on user logged in.
appreciate your help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules