读书人

struts2 action中怎么读取国际化资源文

发布时间: 2012-09-21 15:47:26 作者: rapoo

struts2 action中如何读取国际化资源文件

action中如何读取国际化资源文件

1、在url地址中使用?request_locale=en_US 或 ?request_locale=zh_CN

2、在action中,this.getText("helloworld");?? //得到国际化资源文件中对应的中文, 或是英文

helloworld=hello, {0}????? 使用this.getText("helloworld", new String[]{"张三"})? 初始化点位符

读书人网 >开源软件

热点推荐