The cannot change HTTP accept Header-use A different locale resolution strategy bug occurs when the system learns the SPRINGMVC process and exercises.
Internationalization needs to meet three needs
1. Localize time, values, labels, etc. on the page
2. Need to get the internationalized resource file locale corresponding message from the bean
3. You can toggle the locale dynamically via hyperlinks
Implementation method:
First configure the resource file
I18n_zh_cn.properties Chinese configuration file
i18n.user=\u7528\u6237\u540d
i18n.password=\u5bc6\u7801 (here is the conversion of Chinese to ASCII code)
I18n_en_us.properties English configuration file
I18n.user=user
I18n.password=password
Requirements 1 Implementation
Requirements 2 Implementation
Requirement 3 solution requires configuration of Sessionlocalresolver and Localchangeinterceptor
Sessionlocaleresolver is to save the locale object in the session for later access
My problem is sessionlocaleresolver here, when configuring this bean, the ID must be localeresolver, otherwise it will appear I this bug
SPRINGMVC internationalization Setup appears cannot change HTTP accept Header-use A different locale resolution strategy bug