title: Custom message with FacesContext.getCurrentInstance().addMessage is not displayed in page (JSF)
body: <p>My page:</p>
  
  <pre><code>...
      &lt;div id="header"&gt;
         &lt;!-- content header --&gt;
       &lt;/div&gt;
       &lt;div id="content"&gt;
         &lt;h:messages /&gt;
         &lt;h:ouputText value="#{example.text}" /&gt;
       &lt;/div&gt;
  ...
  </code></pre>
  
  <p>My managedBean:</p>
  
  <pre><code>public class ExampleManagedBean(){
         private String text;
  
  
         public String getText(){
             FacesContext.getCurrentInstance().
                     addMessage(null, 
                        new FacesMessage(FacesMessage.SEVERITY_WARN, 
                                         "Warning message...", null));
             return text;
         }
  
         public void setText(String text){
             this.text = text;
         }
     }
  </code></pre>
  
  <p>My problem is that the warning message not is rendered in page. Why?</p>