浏览 3797 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-11-06
百度、google了几天,发现都是appfuse1的解决办法,appfuse2的几乎没有,有的只是从生成的war档文件中修改,但是如果重新修改添加displaytag之后就又有问题了,没有冲根本上解决…… 这个过程中,发现ApplicationResources_zh.properties却无论如何都没有乱码。后来仔细检查pom.xml配置文件,发现ApplicationResources_zh.properties和displaytag_zh.properties对配置还真不一样,原文件对ApplicationResources.properties的相关配置文件是: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>native2ascii-maven-plugin</artifactId> <version>1.0-alpha-1</version> <configuration> <dest>target/classes</dest> <src>src/main/resources</src> </configuration> <executions> <execution> <id>native2ascii-utf8</id> <goals> <goal>native2ascii</goal> </goals> <configuration> <encoding>UTF8</encoding> <includes> ApplicationResources_ko.properties, ApplicationResources_no.properties, ApplicationResources_tr.properties, ApplicationResources_zh*.properties </includes> </configuration> </execution> <execution> <id>native2ascii-8859_1</id> <goals> <goal>native2ascii</goal> </goals> <configuration> <encoding>8859_1</encoding> <includes> ApplicationResources_de.properties, ApplicationResources_fr.properties, ApplicationResources_nl.properties, ApplicationResources_pt*.properties ApplicationResources_zh*.properties </includes> </configuration> </execution> </executions> </plugin> 以及—— <resource> <directory>src/main/resources</directory> <excludes> <exclude>ApplicationResources_de.properties</exclude> <exclude>ApplicationResources_fr.properties</exclude> <exclude>ApplicationResources_ko.properties</exclude> <exclude>ApplicationResources_nl.properties</exclude> <exclude>ApplicationResources_no.properties</exclude> <exclude>ApplicationResources_pt*.properties</exclude> <exclude>ApplicationResources_tr.properties</exclude> <exclude>ApplicationResources_zh*.properties</exclude> <exclude>applicationContext-resources.xml</exclude> <exclude>struts.xml</exclude> </excludes> <filtering>true</filtering> </resource> 发现一直都没有对关于ApplicationResources以外的*.properties文件进行配置处理,于是照以上看来native2ascii只有对ApplicationResources进行了国际化编码了而已,其他的都没有进行。于是做了一下修改—— <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>native2ascii-maven-plugin</artifactId> <version>1.0-alpha-1</version> <configuration> <dest>target/classes</dest> <src>src/main/resources</src> </configuration> <executions> <execution> <id>native2ascii-utf8</id> <goals> <goal>native2ascii</goal> </goals> <configuration> <encoding>UTF-8</encoding> <includes> ApplicationResources_ko.properties, ApplicationResources_no.properties, ApplicationResources_tr.properties, *_zh*.properties </includes> </configuration> </execution> <execution> <id>native2ascii-8859_1</id> <goals> <goal>native2ascii</goal> </goals> <configuration> <encoding>8859_1</encoding> <includes> ApplicationResources_de.properties, ApplicationResources_fr.properties, ApplicationResources_nl.properties, ApplicationResources_pt*.properties </includes> </configuration> </execution> </executions> </plugin> 以及—— <resource> <directory>src/main/resources</directory> <excludes> <exclude>ApplicationResources_de.properties</exclude> <exclude>ApplicationResources_fr.properties</exclude> <exclude>ApplicationResources_ko.properties</exclude> <exclude>ApplicationResources_nl.properties</exclude> <exclude>ApplicationResources_no.properties</exclude> <exclude>ApplicationResources_pt*.properties</exclude> <exclude>ApplicationResources_tr.properties</exclude> <exclude>*_zh*.properties</exclude> <exclude>applicationContext-resources.xml</exclude> <exclude>struts.xml</exclude> </excludes> <filtering>true</filtering> </resource> 注意以上做了红字部分的修改 最后重启项目,登录测试,发现一切Ok,后来不管在displaytag对显示属性中作任何修改,乱码都不会出现,看来是彻底解决了。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-11-06
请问楼主:你生成工程代码时有没有使用fullsource方式?如果没有,能否试一下(试之前一定要备份完整的工程源码),再看看你的方案是否仍然有效?
|
|
返回顶楼 | |
发表时间:2007-11-07
movingboy 写道 请问楼主:你生成工程代码时有没有使用fullsource方式?如果没有,能否试一下(试之前一定要备份完整的工程源码),再看看你的方案是否仍然有效?
您說對了,在下正是使用mvn appfuse:full-source之后做以上方案的。 |
|
返回顶楼 | |