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