Facesmessage severity
If I have a FacesMessage Object, how do I find severity. FOr eg: getSeverity()......
Any help would b开发者_StackOverflow社区e greatly appreciated. Thanks
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();
}
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!
精彩评论