Hi,
I noticed that trying to fetch the locale in a tag lib using the following doesn't seem to work correctly:
Any ideas why this doesn't work?Code:Locale locale = pageContext.getRequest().getLocale();
Thanks
jv
Hi,
I noticed that trying to fetch the locale in a tag lib using the following doesn't seem to work correctly:
Any ideas why this doesn't work?Code:Locale locale = pageContext.getRequest().getLocale();
Thanks
jv
The request.getLocale() method returns the locale from the Accept-Header the client sent along with the request and does not always correspond with the locale set by the LocaleResolver. If you set the AcceptHeaderLocaleResolver it will be the same, if you use another LocaleResolver it can be different because for example a CookieLocaleResolver uses a cookie to retrieve the local from, not the AcceptHeader.
Hope this helps.
rgds,
Alef Arendsen
but in my case, both fmt:message and spring:message return always same locale as request - please see
http://forum.springframework.org/showthread.php?t=17883
Last edited by robyn; May 14th, 2006 at 08:12 PM.