天天看点

资源国际化

resourcebundle的getbundle()方法需要两个参数

第一个参数配置文件的基本名称

第二个参数locale

getbundle()方法会通过两个参数来锁定配置文件

res_en_us.properties内容

username=username

password=password

login=login

res_zh_cn.properties内容

username=用户名

password=密码

login=登陆

请求头:accept-language:<code>zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3</code>

locale locale=request.getlocale();

继续阅读