appfuse1.9x displaytag中文乱码

ant new了一个新工程,部署上去后displaytab出现乱码,解决步骤:

  1. appfuse ant new出来之后的displaytag_zh_CN.properties文件里面中文乱码,从源代码中将该文件替换;
  2. 修改build.xml ,具体看修改后第7、15行。

修改前:

<!-- Copy any resource or configuration files -->
    <target name="copy-resources" depends="prepare"
        description="Copy .properties and .xml files from source directory">
        <copy todir="${build.dir}/web/classes" includeEmptyDirs="no">
            <fileset dir="web/WEB-INF/classes">
                <exclude name="ApplicationResources_zh*.properties"/>
                <include name="*.properties"/>
                <include name="*.xml"/>
                <include name="*.vm"/>
            </fileset>
            <filterset refid="variables.to.replace"/>
        </copy>
        <native2ascii src="web/WEB-INF/classes" dest="${build.dir}/web/classes" 
            includes="ApplicationResources_zh*.properties" encoding="UTF-8"/>
        <generate-database-properties/>
        <copy todir="${build.dir}/web/classes" file="database.properties"/>
    </target>

 修改后:

 

<!-- Copy any resource or configuration files -->
    <target name="copy-resources" depends="prepare"
        description="Copy .properties and .xml files from source directory">
        <copy todir="${build.dir}/web/classes" includeEmptyDirs="no">
            <fileset dir="web/WEB-INF/classes">
                <exclude name="ApplicationResources_zh*.properties"/>
                <exclude name="displaytag_zh_*.properties"/>
                <include name="*.properties"/>
                <include name="*.xml"/>
                <include name="*.vm"/>
            </fileset>
            <filterset refid="variables.to.replace"/>
        </copy>
        <native2ascii src="web/WEB-INF/classes" dest="${build.dir}/web/classes" 
            includes="ApplicationResources_zh*.properties displaytag_zh_*.properties" encoding="UTF-8"/>
        <generate-database-properties/>
        <copy todir="${build.dir}/web/classes" file="database.properties"/>
    </target>

 

 

最后页面正常了


appfuse1.9x displaytag中文乱码
 

 

你可能感兴趣的:(乱码,displaytag,i18n)