appfuse乱码解决

最近用appfuse总是出来乱码问题,经过人指点后才明白是工程里的配置文件pom.xml问题,原来pom.xml中默认没有displayTable中的中文配置。


pom.xml源文件(部分):


                   <execution>
                        <id>native2ascii-utf8</id>
                        <goals>
                            <goal>native2ascii</goal>
                        </goals>
                        <configuration>
                            <encoding>UTF8</encoding>
                            <includes>ApplicationResources_*.properties</includes>
                            <excludes>ApplicationResources.properties,
                                ApplicationResources_de*.properties,
                                ApplicationResources_fr*.properties,
                                ApplicationResources_nl*.properties,
                                ApplicationResources_pt*.properties,
                                ApplicationResources_es*.properties</excludes>
                        </configuration>
                    </execution>

	<resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>ApplicationResources*.properties</exclude>
                </excludes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>target/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>


pom.xml修改后

	<execution>
                        <id>native2ascii-utf8</id>
                        <goals>
                            <goal>native2ascii</goal>
                        </goals>
                        <configuration>
                            <encoding>UTF8</encoding>
                            <includes>ApplicationResources_*.properties,
                            		*_zh*.properties</includes>
                            <excludes>ApplicationResources.properties,
                                ApplicationResources_de*.properties,
                                ApplicationResources_fr*.properties,
                                ApplicationResources_nl*.properties,
                                ApplicationResources_pt*.properties,
                                ApplicationResources_es*.properties</excludes>
                        </configuration>
                    </execution>




	<resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>ApplicationResources*.properties</exclude>
                     <exclude>*_zh*.properties</exclude>
                </excludes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>target/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>

即:

在native2ascii-utf8中添加: displaytag_zh*.properties

在resources中添加:<exclude>displaytag_zh*.properties</exclude>

然后在工程文件件下执行一下clean后编译,在运行工程即可解决乱码。

你可能感兴趣的:(Appfuse)