开发者

Language parameter on the link

开发者 https://www.devze.com 2023-02-26 00:00 出处:网络
exists an easy method to have the language always at first in the link without change every controller in Spring MVC?

exists an easy method to have the language always at first in the link without change every controller in Spring MVC?

For example

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号