@RequestScoped
public class MessageBean {
public void generateMessages() {
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.addMessage("form:escaped", new FacesMessage("the html <b>is escaped</b>"));
facesContext.addMessage("form:unescaped", new FacesMessage("the html <b>is not escaped</b>"));
facesContext.addMessage(null, new FacesMessage("A <a href='http://richfaces.org'>RichFaces</a> global message <b>with html</b>"));
}
}