title: Can I look up a web app context url from a eager ApplicationScoped managed bean?
body: <p>I want to get a web application context url (ex.: <code>http://myserver:8080/myApp</code>) and store it in the database at startup.</p>
  
  <p>I know how to hook a method call in the startup by using: <code>@ApplicationScoped</code> combined with <code>@ManagedBean(eager=true)</code> and <code>@PostConstruct</code> </p>
  
  <p>And  <code>ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()</code> will give me the context path.</p>
  
  <p>However, since the method annotated with <code>@PostConstruct</code> is not being triggered by a request (since it's eager) getRequestContextPath() is giving me <code>null</code>.</p>