内容简介:将bean id从“localResolver”更改为“localeResolver”翻译自:https://stackoverflow.com/questions/23766446/cannot-change-http-accept-header-use-a-different-locale-resolution-strategy
我在Pluralsight上关注Spring mvc课程,在运行我的应用程序时,我有“无法更改HTTP接受标头 – 使用不同的区域设置解析策略”这个错误.
在此之前,我将theese beans添加到servlet-config.xml
<mvc:interceptors> <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="language" /> </mvc:interceptors> <bean id="localResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" p:defaultLocale="en" />
在资源文件夹中我有两个文件. messages_es.properties和messages.properties.一个hasgoal.text = Minutos Ejercicio paraelíídehoy:和其他goal.text =分钟今日锻炼:
所以目标是选择语言.
在jsp文件中,我有关于它的这一行
语言:<a href =“?language = en”>英语</ a> |<a href =“?language = es”>西班牙语</ a>
那么我怎样才能让它正常工作呢?
将bean id从“localResolver”更改为“localeResolver”
翻译自:https://stackoverflow.com/questions/23766446/cannot-change-http-accept-header-use-a-different-locale-resolution-strategy
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- pip 20.3 发布:更改默认依赖解析器、即将停止至支持 Python 2.7
- MongoDB更改oplog大小
- ios – 更改NSURL的方案
- Vagrant更改默认的SSH端口
- Firefox 75.0 发布,地址栏更改
- Vagrant更改默认的SSH端口
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Beginning XML with DOM and Ajax
Sas Jacobs / Apress / 2006-06-05 / USD 39.99
Don't waste time on 1,000-page tomes full of syntax; this book is all you need to get ahead in XML development. Renowned web developer Sas Jacobs presents an essential guide to XML. Beginning XML with......一起来看看 《Beginning XML with DOM and Ajax》 这本书的介绍吧!