`
flashing
  • 浏览: 349690 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Struts2的国际化资源搜索顺序

UP 
阅读更多
按文档的说法:
ActionClass.properties
Interface.properties (every interface and sub-interface)
BaseClass.properties (all the way to Object.properties)
ModelDriven's model (if implements ModelDriven), for the model object repeat from 1
package.properties (of the directory where class is located and every parent directory all the way to the root directory)
search up the i18n message key hierarchy itself
global resource properties

也就是说(都省略了.properties以及语言的后缀),先是Action类
然后Action接口
然后是父类
然后是ModelDriven的Model类,当然得实现了Model;对于Model来说,从头开始重复搜索;
----------华丽滴分割线------------
然后是package.properties文件,并且顺着搜索到所有父package
搜索继承体系里面所有的i18n的key
最后是global的资源文件。

该怎么分割,估计聪明如你也该想明白了吧:)类一级的,功能一级的,系统一级的。估计三级就够了。btw为什么是三级,囧。
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics