title: Passing text field values from jsf page to managed bean
body: <p>I have a JSF form which calls a method of a managed bean when the action button is clicked. The method is successfully called, but now I would like to access the values entered in the form field from the bean. Here is my code.</p>
  
  <p>The view:</p>
  
  <pre><code>&lt;h:form class="form-horizontal" action= "#{hello_World.message}" method="post" id="formId"&gt;      
   &lt;div class="control-group"&gt;
    &lt;label class="control-label" for="inputEmail"&gt;First Name&lt;/label&gt;
    &lt;div class="controls"&gt;
    &lt;h:inputText id="firstname" placeholder="First Name" value="#{submission.firstName&gt; &lt;/h:inputText&gt;
    &lt;/div&gt; 
  
    &lt;div class="control-group"&gt;
     &lt;label class="control-Label"&gt;Address&lt;/label&gt;
     &lt;div class="controls"&gt;
     &lt;input type="text" placeholder="Address" /&gt;
     &lt;/div&gt;
     &lt;/div&gt;
      &lt;h:commandButton value="click" action="#{submission.submitted}"/&gt;       
  &lt;/h:form&gt;
  </code></pre>
  
  <p>The model:</p>
  
  <pre><code>@ManagedBean(name="submission", eager=true)
  public class MainClass {    
  String firstName = "Pranbsh";
  public MainClass(){
      System.out.println("Helloworld started from managed bean");
  }
  private String getFirstName(){
      return firstName;
  }
  public void submitted(){
      System.out.println("Bean executed");
      System.out.println("First name is ") ;      
    }
  }
  </code></pre>