![](/img/trans.png)
[英]javax.servlet.ServletException: Can't find bundle for base name messages, locale es
[英]JSF : java.util.MissingResourceException: Can't find bundle for base : Only if context root is changed
我已經閱讀了很多有關MissingResourceException問題的主題。 我使用的是Primefaces 5.1.3,我遇到以下錯誤:
java.util.MissingResourceException: Can't find bundle for base [...], locale
在face-config.xml中:
<message-bundle>message.erreur.MsgErreurPrimefaces</message-bundle>
在我的資料中:
戰爭擠在一個EAR中。 當我保留默認上下文根目錄時,它工作正常,但是如果更改上下文根目錄,則會收到消息。
該文件位於戰爭的WEB-INF文件夾下:
WEB-INF / classes / message / erreur / MsgErreurPrimefaces_fr_FR.properties
謝謝
我之前遇到過此類錯誤,並且已通過如下編輯糾正了我的問題。 首先,我建議您添加並測試MsgErreurPrimefaces.properties文件。
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
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">
<application>
<resource-bundle>
<base-name>message.erreur.MsgErreurPrimefaces</base-name>
<var>myBundle</var>
</resource-bundle>
</application>
<application>
<message-bundle>message.erreur.MsgErreurPrimefaces</message-bundle>
<locale-config>
<default-locale>fr_FR</default-locale>
<supported-locale>fr_FR</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
</application>
</faces-config>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.