Java.util.MissingResourceException: Could not find package for messages with base names, locale en_US

I am new to JSF and I tried to use this piece of code. These are my faces-config.xml:

<application>
        <resource-bundle>
            <base-name>messages</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>

Messages is a file in which several properties are stored, and the message file is not placed under any directory, it is placed directly under the application. Why can't I access this file? Thanks in advance. Please let me know if you need more information.

+5
source share
2 answers

looks like your file placed in some package inside your folder src

<base-name>some.package.name.Messages</base-name>

also make sure the file named Messages.properties

btw do you know that the Messages.propertiesfile will allow you to override your validator error messages?

, JSF 2

+5

src, . .

+3

All Articles