struts2资源文件.property

struts2.2.3.1的资源文件,即:.property文件。

用途一:在经过action处理后返回的页面,可以通过<s:text name="propertyName">标签来显示资源文件中的配置值。

用途二:在<s:form>中如果未指定<s:textfield name="paramName">的label属性,则在执行action后返回时会自动将资源文件的属性值作为label来显示。此时,两者必需name相同。

用途三:国际化

   在struts.xml中配置如下:

<constant name="struts.custom.i18n.resources" value="global" />

  这样global.property就是国际化文件了,配置对应国家的文件global_**.property,然后在执行的时候会根据你当前所在的地区执行获取对应文件中的值。

猜你喜欢

转载自guofc201007.iteye.com/blog/1198490