Language parameter on the link
exists an easy method to have the language always at first in the link without change every controller in Spring MVC?
For example
site.com/en/link.html
s开发者_JAVA技巧ite.com/de/link.html
site.com/it/link.html
and this language parameter pass automatically "language=en".
I'm using LocaleChangeInterceptor
LocaleChangeInterceptor looks for locale changes. It doesn't resolve a locale for the request. What you need is an implementation of LocaleResolver interface, specifically
resolveLocale(HttpServletRequest request)
method, which would get that language parameter from the URL.
精彩评论