appfuse中displaytag中文乱码问题的解决

在appfuse中设置好ApplicationResource_zh*.properties相关内容以后,新增加的内容中文显示就没有问题了,但是表格上方和下方的文字还是乱码,经查是displaytag没有设置中文的问题。可以说是appfuse编译过程的错误吧。

现有的appfuse编译,有如下这一段:

<target name="copy-resources" depends="prepare"></target>        description="Copy .properties and .xml files from source directory">
        <copy todir="${build.dir}/web/classes" includeemptydirs="no"></copy>
            <fileset></fileset>
                <exclude name="ApplicationResources_zh*.properties"></exclude>
                <exclude name="ApplicationResources_de.properties"></exclude>
                <exclude name="ApplicationResources_fr.properties"></exclude>
                <exclude name="ApplicationResources_nl.properties"></exclude>
                <exclude name="ApplicationResources_pt*.properties"></exclude>
                <include name="*.properties"></include>
                <include name="*.xml"></include>
                <include name="*.vm"></include>
           
            <filterset refid="variables.to.replace"></filterset>
       
        <native2ascii src="web/WEB-INF/classes" dest="${build.dir}/web/classes"></native2ascii>            includes="ApplicationResources_zh*.properties" encoding="UTF-8"/>

可以看到,对于ApplicationResources_zh*.properties文件没有直接拷贝,而是通过native2ascii进行了转换,这样的内容就不会产生乱码。而displaytag_zh*.properties直接被拷贝过去,还是utf-8格式,因此页面显示是乱码。

修改方法如下:

    <target name="copy-resources" depends="prepare"></target>           <target name="copy-resources" depends="prepare"></target>        description="Copy .properties and .xml files from source directory">
        <copy todir="${build.dir}/web/classes" includeemptydirs="no"></copy>
            <fileset></fileset>
                <exclude name="ApplicationResources_zh*.properties"></exclude>
                <exclude name="ApplicationResources_de.properties"></exclude>
                <exclude name="ApplicationResources_fr.properties"></exclude>
                <exclude name="ApplicationResources_nl.properties"></exclude>
                <exclude name="ApplicationResources_pt*.properties"></exclude>
                <exclude name="displaytag_zh*.properties"></exclude>
                <include name="*.properties"></include>
                <include name="*.xml"></include>
                <include name="*.vm"></include>
           
            <filterset refid="variables.to.replace"></filterset>
       
        <native2ascii src="web/WEB-INF/classes" dest="${build.dir}/web/classes"></native2ascii>            includes="*_zh*.properties" encoding="UTF-8"/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值