title: Replacing @ManagedBean(eager=true) in JSF22
body: <p>I am looking for a solution to replace the <code>@ManagedBean(eager=true)</code> annotation in JSF 2.2.</p>
  
  <p>I took good note of proposals <a href="http://ovaraksin.blogspot.fr/2013/02/eager-cdi-beans.html" rel="nofollow">such as</a> which allow the execution of code at application start up.</p>
  
  <p>I need however to access the <code>FacesContext</code>, so this solution does not work : <code>FacesContext.getCurrentInstance()</code> is still null at this time.</p>
  
  <p>I tried to find alternatives to <code>AfterDeploymentValidation</code> in SPI, but found nothing.</p>
  
  <p>As developpers of DeltaSpike do not seem to plan to implement a substitution to <a href="https://issues.apache.org/jira/browse/DELTASPIKE-453" rel="nofollow"><code>@ManagedBean(eager=true)</code></a> and as OmiFaces does not yet support this kind of solution, <a href="https://github.com/omnifaces/omnifaces/issues/18" rel="nofollow">see</a>. I am sending a message in a bottle.</p>
  
  <p>For the time being, I just access the <code>@ManagedScoped(eager=true)</code> bean, transformed into a <code>@Named</code>, in my webapp common xhtml header, but it is kind of ugly.</p>