码迷,mamicode.com
首页 > 其他好文 > 详细

hello struts2 ( 一 )

时间:2014-12-13 21:40:22      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   on   文件   

1.struts2的国际化

  struts.xml中配置以下代码,要求src下有message_XX_xx.properties资源文件。(有关struts2的国际化见 struts2国际化

1 <struts>
2   <constant name="struts.custom.i18n.resources" value="message"></constant>
3   <constant name="struts.i18n.encoding" value="UTF-8"></constant>
4 </struts>

  若不能成功加载,在struts.properties中加入以下属性。(有关properties参见 struts.properties

1 struts.i18n.reload=true
2 struts.locale=zh_CN
3 struts.i18n.encoding=UTF-8
4 struts.custom.i18n.resources=message

 2.struts2模块化

  当系统越来越大,struts.xml也在变得复杂,为了减少struts.xml的臃肿,可以把Action按不同模块放入不同xml配置文件中,再把各配置文件导入

 struts.xml中,这些xml配置文件也是标准的struts2配置文件,包含DTD信息,struts2根元素等信息。

1 <struts>
2         <include file="struts-p1.xml" />
3         <include file="struts-p2.xml" />
4 </struts>

3.Action中的属性

hello struts2 ( 一 )

标签:style   blog   http   io   ar   color   sp   on   文件   

原文地址:http://www.cnblogs.com/niceToString/p/4161831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!