Spring / Spring MVC Interview questions
How to implement localization in Spring MVC applications?
Spring framework provides LocaleResolver to support the internationalization and localization. To have your Spring MVC application support the internationalization, you will need to register two beans.
SessionLocaleResolver resolves locales by inspecting a predefined attribute in the user's session. If the session attribute does not exist, this locale resolver determines the default locale from the accept-language HTTP header.
LocaleChangeInterceptor interceptor detects if a special parameter is present in the current HTTP request. The parameter name can be customized with the paramName property of this interceptor. If such a parameter is present in the current request, this interceptor changes the user?s locale according to the parameter value.
More Related questions...