Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSF错误:Can';找不到基本名称xxxx、区域设置xxxx的捆绑包_Jsf_Internationalization - Fatal编程技术网

JSF错误:Can';找不到基本名称xxxx、区域设置xxxx的捆绑包

JSF错误:Can';找不到基本名称xxxx、区域设置xxxx的捆绑包,jsf,internationalization,Jsf,Internationalization,我正在尝试将我的应用程序国际化,并在这方面搜索了很多教程。我总是在这一点上卡住,因为无论我做什么配置,它们都不起作用 早些时候,我在一个网站上发了一篇帖子。解决此解析器异常后,现在应用程序找不到捆绑包 我通过faces-config.xml以及支持的区域设置安排并注册了核心捆绑包 尽管我已经搜索了现有的解决方案,但它们似乎都不适用于我的案例 那么,事情在哪里?它必须在根文件夹中吗?这是一种误解吗?我的faces配置中有一个输入错误(别这么认为,我重拨了很多次) 配置如下: <?xml ve

我正在尝试将我的应用程序国际化,并在这方面搜索了很多教程。我总是在这一点上卡住,因为无论我做什么配置,它们都不起作用

早些时候,我在一个网站上发了一篇帖子。解决此解析器异常后,现在应用程序找不到捆绑包

我通过faces-config.xml以及支持的区域设置安排并注册了核心捆绑包

尽管我已经搜索了现有的解决方案,但它们似乎都不适用于我的案例

那么,事情在哪里?它必须在根文件夹中吗?这是一种误解吗?我的faces配置中有一个输入错误(别这么认为,我重拨了很多次)

配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
    <application>
<!--        <message-bundle>messages_en_US</message-bundle> -->
<!--        <message-bundle>messages_es</message-bundle> -->
<!--        <message-bundle>messages_pt_BR</message-bundle> -->
        <locale-config>
            <default-locale>en_US</default-locale>
            <supported-locale>pt_BR</supported-locale>
            <supported-locale>es</supported-locale>
        </locale-config>

        <resource-bundle>
            <base-name>com.tfduque.fieldassist.interface</base-name>
            <var>msg</var>

        </resource-bundle>
    </application>

</faces-config>

通过删除文件的完整路径解决了此问题-仅文件名似乎就足够了:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
    <application>
<!--        <message-bundle>messages_en_US</message-bundle> -->
<!--        <message-bundle>messages_es</message-bundle> -->
<!--        <message-bundle>messages_pt_BR</message-bundle> -->
        <locale-config>
            <default-locale>en_US</default-locale>
            <supported-locale>pt_BR</supported-locale>
            <supported-locale>es</supported-locale>
        </locale-config>
<!--- Change the path ("com.tfduque.fieldassist.interface") to the filename ("interface") here -->    
        <resource-bundle>
            <base-name>interface</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>

</faces-config>

恩努斯
pt_BR
锿
接口
味精

“尽管我已经搜索了现有的解决方案,但它们似乎都不适用于我的案例。”哪些解决方案?声明跟踪它们并在Q中提及它们。否则,您很可能会将此Q作为StackOverflow中现有Q/a的一个副本关闭。这真的很奇怪:com.tfduque.fieldassist.interface_es,locale pt_BR。接口不应该是“接口”,这实际上表明它正在查找一个文件
interface\es\u pt\BR.properties
,它确实不在那里,因此错误是正确的!
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
    <application>
<!--        <message-bundle>messages_en_US</message-bundle> -->
<!--        <message-bundle>messages_es</message-bundle> -->
<!--        <message-bundle>messages_pt_BR</message-bundle> -->
        <locale-config>
            <default-locale>en_US</default-locale>
            <supported-locale>pt_BR</supported-locale>
            <supported-locale>es</supported-locale>
        </locale-config>
<!--- Change the path ("com.tfduque.fieldassist.interface") to the filename ("interface") here -->    
        <resource-bundle>
            <base-name>interface</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>

</faces-config>