If I have a FacesMessage Object, how do I find severity. FOr eg: getSeverity()......
Any help would be greatly appreciated. Thanks
If I have a FacesMessage Object, how do I find severity. FOr eg: getSeverity()......
Any help would be greatly appreciated. Thanks
For those kind of questions, you need to consult the API documentation of the class in question. The one for FacesMessage
is located here. Now, scan the list of available methods to see for something useable. And see.. Yes, there's a getSeverity()
method!
Simply look in the FacesContext
instance for the list of messages, then get the severity for a specific message:
Iterator<FacesMessage> msgs = FacesContext.getCurrentInstance().getMessages();
for (FacesMessage msg : msgs) {
msg.getSeverity();
}