Struts1国际化

1.写ApplicationResources.properties文件
peizhi = /xxxx/xxxx(这个里用%java_home%\bin\native2ascii传换下)

2.在struts-config.xml中配置
<message-resources
		parameter="com.xxx.ApplicationResources"
		null="false" key="cfgkey">
</message-resources>


3.将文字替换成标签
<bean:message bundle="cfgkey" key="peizhe"/>




action中获取资源文件的方法:
this.getResources(request,"cfgkey").getMessage(this.getLocale(request), "peizhe");

你可能感兴趣的:(java,xml,struts)