I was wondering how you can add a “success” message on a JSF page when the submitted data in a h:form is valid. e.g. “record successfully inserted”. I tried using FacesContext.addMessage(String clientId, String message), but the message gets displayed in the same h:messages box that displays error messages in case of invalid data, resulting in text with a red color. I wish not to use JavaScript Alerts.
Any help would be greatly appreciated.
use different style class
When adding message
for success
for failure