title: Difference between by Application#getResourceBundle() and ResourceBundle#getBundle() in JSF 2.0
body: <p>In order to retreive Strings from the resourse bundle, i am trying to compare the result from this two methods, below an example for the code:</p>
  
  <p><strong>First Example:</strong></p>
  
  <p>baseName: The fully qualified name of the resource bundle (<code>&lt;base-name&gt;</code> in <code>&lt;resource-bundle&gt;</code>).</p>
  
  <pre><code>FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ResourceBundle bundle = app.getResourceBundle(context, baseName);
  </code></pre>
  
  <p><strong>Second Example:</strong></p>
  
  <p>varName: is the String representing the <code>&lt;var&gt;&lt;/var&gt;</code> in <code>&lt;resource-bundle&gt;</code></p>
  
  <pre><code>FacesContext context = FacesContext.getCurrentInstance();
  Locale locale = context .getViewRoot().getLocale();
  ClassLoader loader = Thread.currentThread().getContextClassLoader();
  ResourceBundle bundle = ResourceBundle.getBundle(varName, locale, loader);
  </code></pre>
  
  <p>What is the difference between these tow examples? if no difference, what would be the best practice to get ResourceBundle (to use Application#getMessageBundle() or ResourceBundle#getBundle()) ?</p>