title: Accessing session bean data in constructor of JSF managed bean
body: <p>I am trying to access the session bean data in the managed bean constructor. For that purpose I am using <code>@ManagedProperty</code> annotation as below. When I try to access in constructor it gives  <code>java.lang.NullPointerException</code> and the same piece of code is accessible in another function. May be I need to do something different for constructor. Could someone please guide me what I need to do.</p>
  
  <pre><code>@ManagedProperty(value="#{sessionBean}")
  private SelectCriteriaBean sessionData; 
  
  // This is contructor
  public ModifyBusinessProcessBean() {
    logger.debug(getSessionData().getSelectedBusinessProcessLevelZero());     
  }
  
  // Another Function where the same code doesn't give error
  public anotherFunction() {
    logger.debug(getSessionData().getSelectedBusinessProcessLevelZero());     
  }
  </code></pre>