maven i18n JSF2 UTF8编码

时间:2015-12-23 19:50:59

标签: maven java-ee jsf-2 utf-8

在我的应用程序(Jdk 1.7,JSF2,Maven 3,Spring ...)中,我尝试了以下配置将UTF-8编码设置为我的messages_xx_XX.properties i18n文件:

i18n with UTF-8 encoded properties files in JSF 2.0 appliaction

我在Eclipse中运行应用程序时遇到问题,但是当我尝试在独立的Tomcat 7配置中运行时(为了在Openshift平台上部署应用程序),我有以下错误:

java.util.MissingResourceException: Can't find bundle for base name fr.gf.predic.web.i18n.BundleUTF8Perso, locale fr_FR

这是我的应用程序配置:
faces-config.xml

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">

<managed-bean>
    <managed-bean-name>currentDate</managed-bean-name>
    <managed-bean-class>java.util.Date</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

<application>
    <locale-config>
        <default-locale>fr-FR</default-locale>
        <supported-locale>fr-FR</supported-locale>
    </locale-config>

    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

    <resource-bundle>
        <base-name>fr.gf.predic.web.i18n.BundleUTF8Perso</base-name>
        <var>msg</var>
    </resource-bundle>
</application>

属性文件位于fr/gf/predic/i18n/textes文件夹下的src/main/resources文件夹中。

在我的pom.xml中,我有以下插件过滤此文件夹:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
                <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                <webResources>
                    <resource>
                        <directory>src/main/webapp/resources</directory>
                        <filtering>true</filtering>
                        <excludes>
                            <exclude>**/*.less</exclude>
                        </excludes>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

我不知道问题可能来自哪里。

0 个答案:

没有答案