title: NullpointerException in getExternalContext in FacesContext
body: <p>I tried to get external context from FacesContext as followed and got NullPointerException:</p>
  
  <pre><code>ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
  </code></pre>
  
  <p>What could possibly cause the problem? </p>