tags:

views:

74

answers:

2

If I have a FacesMessage Object, how do I find severity. FOr eg: getSeverity()......

Any help would be greatly appreciated. Thanks

+1  A: 

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!

BalusC
+1  A: 

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();
}
romaintaz
He said he already has a `FacesMessage` instance at hands.
BalusC
Yes, but I don't understand where is his problem. He has the object, he has the method name... So what does he need? ;)
romaintaz
Maybe he randomly guessed and didn't realize to already answer his own question ;)
BalusC