If you want to check if the user has entered data, you can also use the required attribute of the input field in combination with the requiredMessage field, for example. for input field:
<h:inputText value="#{myBean.beansField}" required="true" requiredMessage="Can not be null"/>
If you want to overwrite messages in general, you need to edit or overwrite the messages.properties file:
- Add this to your faces-config.xml inside the application element:
<locale-config><default-locale>en</default-locale></locale-config> <message-bundle>/resources/messages</message-bundle>
source share