You can drag the Message component
from
the Palette's Basic category to the Visual Designer to create a message related to a single
component. The two message
components, Message and Message Group, display error messages for component rendering and
validation. Message displays error messages for a specific
component.
summary property set to true and the detail property set to false.
for property to the other component and display messages for that component.
You can send your own error text to a Message component by calling the corresponding Java object's info, error, fatal, or warn method. The component displays an appropriate icon for the type of method called.
You can also write your own input validation methods, which can write text to the Message component by throwing ValidatorException(new FacesMessage (String)). If you do not want to throw an exception, you can have the validation method call the Java object's info, error, fatal, or warn method instead.