title: What would be a good way to display static message in facelets?
body: <p>I came across following from a managed bean and .xhtml in jsf 2.x application. This static variable has a long string value and is referred by the bean in .xhtml page to display the message. Armed with limited experience of Java/JSF, I decided to improve it somehow. </p>
  
  <ol>
  <li>Take out static as a first step </li>
  <li>Create proper getter/setter methods </li>
  <li>Load the text message from properties file. </li>
  <li>Bind loaded value to the message variable</li>
  </ol>
  
  <p>Not too convinced of myself so I googled it from here and found this thread: <a href="https://stackoverflow.com/questions/39121760/fetching-the-values-from-a-property-file-inside-a-xhtml-file">fetching the values from a property file inside a XHTML file</a>. That sounds promising but hoping to find the best practice in regards to load/referring static message in JSF.</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class Foo {
      private static String message = "....long...message...";
  
      // getter only available
      public String getMessage() { .... }
  </code></pre>
  
  <p>From .xhtml page:</p>
  
  <pre><code>&lt;h:outputText value="#{foo.message}" /&gt;
  </code></pre>