The below code will be used to display a message dialog on
the JSF page.
the JSF page.
FacesContext
facesContext = FacesContext.getCurrentInstance();
facesContext = FacesContext.getCurrentInstance();
FacesMessage
facesMessage = new FacesMessage(message);
facesMessage = new FacesMessage(message);
facesMessage.setSeverity(severity);
facesContext.addMessage(null, facesMessage);
Where message is
the message what we want to display on the dialog box and severity is to show the severity of the message. Example for
severity is FacesMessage.SEVERITY_INFO which displays the dialog box as an
information message. Inputs for severity is available in FacesMessage class.
the message what we want to display on the dialog box and severity is to show the severity of the message. Example for
severity is FacesMessage.SEVERITY_INFO which displays the dialog box as an
information message. Inputs for severity is available in FacesMessage class.
No Comments