使用displaytag打印表格的时候,表头有时需要使用国际化资源,这些资源往往是properties文件。在开发中各种框架都有自己的国际化资源规则,JSTL,struts,spring,默认displaytag会读取jstl制定的资源文件。
TODO: JSTL, Struts, spring i18n
项目中原有框架(类似appfuse)把struts和jstl的国际化资源都指向ApplicationContext,这个文件是struts的默认资源文件。
项目中,struts在struts-plugin.xml中制定
<constant name="struts.custom.i18n.resources" value="testmessages,testmessages2" />
http://struts.apache.org/2.x/docs/constant-configuration.html
jstl则是通过web.xml中制定
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-val>message</param-val>
</context-param>
jstl,似乎不能制定多个资源文件,这在项目中有些限制,所以我采用struts国际化方式。
displaytag中使用struts资源只需在displaytag.properties文件中添加。
locale.provider=org.displaytag.localization.I18nStrutsAdapter
column中指定titleKey
<display:column property="prop" titleKey="Title.Column.one" />
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
分享到:
相关推荐
DisplayTag标签使用说明DisplayTag标签使用说明DisplayTag标签使用说明DisplayTag标签使用说明DisplayTag标签使用说明DisplayTag标签使用说明
Struts2+displaytag+dbutil 可运行完整web工程 jdk1.6、1.7 tomcat6.0
displaytag所有包(资源) 及使用方法
displaytag的使用方法(用于数据表格的显示和功能控制)Displaytag1.1版本使用方法
示例如何使用displaytag,详细介绍displaytag在使用方式上的不同,具有举一反三的效果
关于displaytag标签的使用 使用方便 做网页的时候用的着
displaytag标签使用详解 应用实例
Struts2整合DisplayTag 实现分页技术
基于DisplayTag的分页方案
很全面的DisplayTag中文帮助文档,对了解和使用该标签有很大的帮助
你可以在现在流行的web应用的MVC模式中集成DisplayTag到View层,其提供的强大表格格式化功能一定会令你爱不释手。或许上面说的有些夸张了,但是DisplayTag在表格的格式化方面表现确实出色,当然,他也只能显示表格,...
非常好的资源,提供用运,技术,思路,例子,是人轻松灵活的运用
用于解决,displaytag的中文显示问题
通过修改源码的方式 解决displaytag中文排序问题.压缩包中包含1.0与1.1版本修改的源文件、编译后的文件,及修改后的jar包。
前些天在DISPLAYTAG官网下载了一个displaytag包,发现不支持中文导出,分页等说明文字也是英文的,现在把它改成中文的了,感觉还不错!省了自己写分页和导出数据包了.
总结网络中Display Tag使用,非常经典,帮助你学习和了解displaytag
NULL 博文链接:https://zhouwenjun.iteye.com/blog/576868
NULL 博文链接:https://fangguanhong.iteye.com/blog/1908593
数据库struts2.3.4.1+hibernate3.6.10+sping3.1.2(sql2000+proxool)+displaytag 据库 struts+hibernate+sping sql2000 proxool displaytag