读书人

displaytag中运用struts的国际化资源

发布时间: 2012-11-16 14:12:14 作者: rapoo

displaytag中使用struts的国际化资源
使用displaytag打印表格的时候,表头有时需要使用国际化资源,这些资源往往是properties文件。在开发中各种框架都有自己的国际化资源规则,JSTL,struts,spring,默认displaytag会读取jstl制定的资源文件。
TODO: JSTL, Struts, spring i18n
项目中原有框架(类似appfuse)把struts和jstl的国际化资源都指向ApplicationContext,这个文件是struts的默认资源文件。项目中,struts在struts-plugin.xml中制定


http://struts.apache.org/2.x/docs/constant-configuration.html

jstl则是通过web.xml中制定


I18nJstlAdapter,I18nSpringAdapter分别对应jstl和spring。
对于资源文件:You don't need to copy all the properties in any internationalized file (some of them are also configuration properties which don't need to be translated at all). Configure displaytag properly in the main displaytag.properties file and then replicate only the strings you want to translate.

reference:http://displaytag.sourceforge.net/1.2/i18n.html

读书人网 >软件架构设计

热点推荐