I think this message is in the wrong forum, it should be in Web forum. Would appreciate if admin would copy it over to the Web forum.
I found that the default locale resolver in Spring is AcceptHeaderLocaleResolver. To override it, I created my own resolver:
Code:
public class FixedLocaleResolver implements LocaleResolver {
private Locale defaultLocale;
public Locale resolveLocale(HttpServletRequest req) {
return defaultLocale;
}
public void setLocale(HttpServletRequest req, HttpServletResponse res, Locale loc) {
}
public Locale getDefaultLocale() {
return defaultLocale;
}
public void setDefaultLocale(Locale defaultLocale) {
this.defaultLocale = defaultLocale;
}
And in applicationContext.xml:
Code:
<bean id="localeResolver" class="my.package.goes.here.FixedLocaleResolver">
<property name="defaultLocale" value="en"/>
</bean>
But it's still not working. Can someone tell me, do I need to define my localeResolver somewhere else so it can be picked up by application?