1

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 ??

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

You may need to alter the jsp/html page a bit more if it was not yet using an HTML form. jQuery might be useful for that.
@Martin.. of course. thanks for adding more value to the ans.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.