[英]java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US
I am new to JSF an was trying out this piece of code.. This is my faces-config.xml: 我是JSF的新手,正在尝试这段代码..这是我的faces-config.xml:
<application>
<resource-bundle>
<base-name>messages</base-name>
<var>msg</var>
</resource-bundle>
</application>
messages is a file that stores a few properties and messages file is not placed under any directory, it is placed directly under the application. messages是一个存储一些属性的文件,而消息文件没有放在任何目录下,它直接放在应用程序下面。 Why cant i access this file?
为什么我无法访问此文件? Thank you in advance.. please do let me know if you need any additional information..
提前谢谢..如果您需要任何其他信息,请告诉我。
looks like your file placed in some package inside your src
folder 看起来您的文件放在
src
文件夹中的某个包中
<base-name>some.package.name.Messages</base-name>
also make sure the file called Messages.properties
还要确保该文件名为
Messages.properties
btw are you aware that Messages.properties
file will allow you to override your validators error messages? 顺便说一下你知道
Messages.properties
文件将允许你覆盖验证器错误消息吗?
Also, take a look at this nice tutorial JSF 2 message and messages example 另外,看看这个漂亮的教程JSF 2消息和消息示例
If you put it in directly into src folder it should work. 如果你直接把它放到src文件夹中它应该工作。 Athough I would suggest to organize the message files in packages.
虽然我建议在包中组织消息文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.