title: Target Unreachable, identifier 'demoBean' resolved to null
body: <p>I am developing a web application using JSF on Netbeans 7.0. I have created 2 pages: one for entering persons name and other to display that name. I am using a java bean with get and set methods.</p>
  
  <p>I get an error when I submit my form on first page the code.</p>
  
  <p>This is my first page <code>index.xhtml</code> to accept name:</p>
  
  <pre><code>&lt;h:form&gt;
      Enter your Name : &lt;h:inputText value="#{demoBean.name}" required="true"/&gt;
      &lt;br/&gt; &lt;h:commandButton value="Submit" action="welcome.xhtml"/&gt;    
  &lt;/h:form&gt;
  </code></pre>
  
  <p>This is the other page <code>welcome.xhtml</code> to display the name:</p>
  
  <pre><code>&lt;h:body&gt;
      Hello #{demoBean.name}
  &lt;/h:body&gt;
  </code></pre>
  
  <p>This is the managed bean <code>demoBean.java</code>:</p>
  
  <pre><code>import javax.faces.bean.ManagedBean; 
  import javax.faces.bean.SessionScoped; 
  
  @ManagedBean()
  @SessionScoped
  
  public class demoBean {
      private String name;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>This is the error which I got when I submit the fist page:</p>
  
  <blockquote>
    <p>/index.xhtml @10,86 value="#{demoBean.name}": Target Unreachable, identifier 'demoBean'<br>
        resolved to null</p>
  </blockquote>