Class FacesMessage

java.lang.Object
jakarta.faces.application.FacesMessage
All Implemented Interfaces:
Serializable

public class FacesMessage extends Object implements Serializable

FacesMessage represents a single validation (or other) message, which is typically associated with a particular component in the view. A FacesMessage instance may be created based on a specific messageId. The specification defines the set of messageIds for which there must be FacesMessage instances.

The implementation must take the following steps when creating FacesMessage instances given a messageId:

Call Application.getMessageBundle(). If non-null, locate the named ResourceBundle, using the Locale from the current UIViewRoot and see if it has a value for the argument messageId. If it does, treat the value as the summary of the FacesMessage. If it does not, or if Application.getMessageBundle() returned null, look in the ResourceBundle named by the value of the constant FACES_MESSAGES and see if it has a value for the argument messageId. If it does, treat the value as the summary of the FacesMessage. If it does not, there is no initialization information for the FacesMessage instance.

In all cases, if a ResourceBundle hit is found for the {messageId}, look for further hits under the key {messageId}_detail. Use this value, if present, as the detail for the returned FacesMessage.

Make sure to perform any parameter substitution required for the summary and detail of the FacesMessage.

See Also: