Wednesday, February 8, 2012

Internationalization support using Spring MVC application

To make Spring MVC application supports the internationalization, register two beans :
If you don't register the localeResolver the default AcceptHeaderLocaleResolver will be used
to resolve locale by checking the "accept-language" header from the incomming HTTP request.

Note :
If there is a repated need of locale resolution add the above code else we may
get the below exception.
java.lang.UnsupportedOperationException: Cannot change HTTP accept header - use a different locale resolution strategy

Register this to support multiple languages.Property paramName is used to set the locale.


No comments:

Post a Comment