title: h:messages does not display messages when p:commandButton is pressed
body: <p>I have a problem with the h:messages tag in JSF that simply does not show any messages. In the Glassfish log are no errors when I click the button.
  The setup is as follows: </p>
  
  <p>test.xhtml:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui" 
      xmlns:j="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core"&gt;
  &lt;h:head&gt;
      &lt;title&gt;test&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:messages globalOnly="true"/&gt;
      &lt;h:form id="loginform"&gt;         
          &lt;p:commandButton id="testButton" value="Test"
            action="#{loginSessionBean.test()}" /&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>With The SessionScopedBean:</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class LoginSessionBean implements Serializable {
  
  private static final long serialVersionUID = 1L;
  ...
  public String test(){
       FacesContext fc = FacesContext.getCurrentInstance();
       fc.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Test!", null)); 
      return "";
  }
  </code></pre>