Reputation: 77
I'm working on language changes for my page.when the client clicks on any language, page should load in that particular language. For that I configured springs.xml like this
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
The page was loading fine, when I'm give the url like this, site/companykey?lang=french, Now my problem is , I want to hide the param value which I have given ?lang=french. Is there any way to hide that value from the url ??
Upvotes: 1
Views: 8259
Reputation: 820
locate the form in jsp/html page in which you have included these tags used for changing locale. change the attribute method="POST". it will make sure that the parameter will pass to the mapped action class without appearing in the url.
Upvotes: 3