首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

strut2-Could not parse struts.locale setting, substituting default VM locale

2012-10-26 
strut2---Could not parse struts.locale setting, substituting default VM locale在Struts2-core-2.0.14

strut2---Could not parse struts.locale setting, substituting default VM locale
在Struts2-core-2.0.14.jar的org.apache.struts2目录下有
default.properties中的配置为以下(设置语言环境):
### This can be used to set your default locale and encoding scheme
# struts.locale=en_US


解决方法(有两种):

1、在WEB-INF/struts.properties或者src/struts.properties文件中如下配置:
struts.locale=en_GB    或者是  #struts.locale=zh_CN

2、在struts.xml中如下配置; (似乎不好用)
<constant name="struts.locale" value="en_GB" />

注:
struts2中管理struts2属性的3中管理方式:
1.通过struts.properties文件来配置
2.通过strutsxml 文件中配置constant元素来配置
3.在web.xml中配置


struts2配置文件加载顺序:

1.struts-default.xml :在struts-core.jar
2.struts-plugin.xml :在struts2-spring-plugin-2.0.14.jar
3.struts.xml
4.struts.properties
5.web.xml




热点排行