How do I able to fetch all the messages with SEVERITY is ERROR only. I tried:
Iterator<FacesMessage> messages = facesContext.getMessages(clientId);
while (messages.hasNext()){
if(messages.next().getSeverity().toString()=="ERROR 2")System.out.println(messages);
}
Is this th right way? It doesnot intercept messages with ERROR severity.
Any help would be highly appreciated.