title: JSF Stack exception or managed bean trouble
body: <p>I am very new to JSF and have been trying to get this to work for the last hour or so. </p>
  
  <p>This example program I am working on is supposed to display a webpage with several different forms on it. It does that fine (as in it at least works I really do not know how correct the syntax is) and now I implemented some functionality to the form using a managed bean. The goal is to have the page display what the user typed in below to show that it went through, but it seems that there is some sort of <em>*</em>*config.xml problem that I cannot figure out because the project I created in netbeans does not have any sort of config.xml file, it only has a beans.xml file and a web.xml file. I am unsure what (if anything) I need to add to the beans.xml file or if I need to create a new xml file myself or it is something completely different. </p>
  
  <p>I should also mention that when I run this program, the GUI part runs and I can input stuff into the boxes and check the radio boxes and such but when I hit the "Register" button, nothing happens </p>
  
  <p>Here are my files.</p>
  
  <p>index.xhtml </p>
  
  <pre><code>       &lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"&gt;
    &lt;h:head&gt;
      &lt;title&gt;Student Registration Form&lt;/title&gt;
    &lt;/h:head&gt;
    &lt;h:body&gt;
      &lt;h:form&gt;
        &lt;!-- Use h:graphicImage --&gt;
        &lt;h3&gt;Student Registration Form
          &lt;h:graphicImage name="usIcon.gif" library="image"/&gt;
        &lt;/h3&gt;
  
        &lt;!-- Use h:panelGrid --&gt;
        &lt;h:panelGrid columns="6" style="color:green"&gt;
          &lt;h:outputLabel value="Last Name"/&gt;
          &lt;h:inputText id="lastNameInputText" 
                       value="#{Registration.lastName}"/&gt;
          &lt;h:outputLabel value="First Name" /&gt;
          &lt;h:inputText id="firstNameInputText" 
                       value="#{Registration.firstName}"/&gt;
          &lt;h:outputLabel value="MI" /&gt;
          &lt;h:inputText id="miInputText" size="1"
                       value="#{Registration.mi}"/&gt;
        &lt;/h:panelGrid&gt;
  
        &lt;!-- Use radio buttons --&gt;
        &lt;h:panelGrid columns="2"&gt;
          &lt;h:outputLabel&gt;Gender  &lt;/h:outputLabel&gt;           
          &lt;h:selectOneRadio id="genderSelectOneRadio"
                            value="#{Registration.gender}"&gt;
            &lt;f:selectItem itemValue="Male" 
                          itemLabel="Male"/&gt;
            &lt;f:selectItem itemValue="Female" 
                          itemLabel="Female"/&gt;
          &lt;/h:selectOneRadio&gt;
        &lt;/h:panelGrid&gt;
  
        &lt;!-- Use combo box and list --&gt;
        &lt;h:panelGrid columns="4"&gt;
          &lt;h:outputLabel value="Major  "/&gt;
          &lt;h:selectOneMenu id="majorSelectOneMenu"
                           value="#{Registration.major}"&gt;
            &lt;f:selectItem itemValue="Computer Science"/&gt;
            &lt;f:selectItem itemValue="Mathematics"/&gt;
          &lt;/h:selectOneMenu&gt; 
          &lt;h:outputLabel value="Minor  "/&gt;
          &lt;h:selectManyListbox id="minorSelectManyListbox"
                               value="#{Registration.minor}"&gt;
            &lt;f:selectItem itemValue="Computer Science"/&gt;
            &lt;f:selectItem itemValue="Mathematics"/&gt;
            &lt;f:selectItem itemValue="English"/&gt;
          &lt;/h:selectManyListbox&gt; 
        &lt;/h:panelGrid&gt;
  
        &lt;!-- Use check boxes --&gt;
        &lt;h:panelGrid columns="4"&gt;
          &lt;h:outputLabel value="Hobby: "/&gt;
          &lt;h:selectManyCheckbox id="hobbySelectManyCheckbox"
                                value="#{Registration.hobby}"&gt;
            &lt;f:selectItem itemValue="Tennis"/&gt;
            &lt;f:selectItem itemValue="Golf"/&gt;
            &lt;f:selectItem itemValue="Ping Pong"/&gt;
          &lt;/h:selectManyCheckbox&gt;
        &lt;/h:panelGrid&gt;
  
        &lt;!-- Use text area --&gt;
        &lt;h:panelGrid columns="1"&gt;
          &lt;h:outputLabel&gt;Remarks:&lt;/h:outputLabel&gt;  
          &lt;h:inputTextarea id="remarksInputTextarea" 
                           style="width:400px; height:50px;" 
                           value="#{Registration.remarks}"/&gt;
        &lt;/h:panelGrid&gt;
  
        &lt;!-- Use command button --&gt;
        &lt;h:commandButton value="Register" /&gt;
        &lt;br /&gt;
        &lt;h:outputText escape="false" style="color:red"
                      value="#{Registration.response}" /&gt;
      &lt;/h:form&gt;
    &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Registration.java</p>
  
  <pre><code>    package jsf2demo;
  
  import javax.inject.Named;
  import javax.enterprise.context.RequestScoped;
  import javax.faces.bean.ManagedBean;
  
  @ManagedBean
  @javax.faces.bean.RequestScoped
  
  public class Registration {
    private String lastName;
    private String firstName;
    private String mi;
    private String gender;
    private String major;
    private String[] minor;
    private String[] hobby;
    private String remarks;
  
    public String getLastName() {
      return lastName;
    }
  
    public void setLastName(String lastName) {
      this.lastName = lastName;
    }
  
    public String getFirstName() {
      return firstName;
    }
  
    public void setFirstName(String firstName) {
      this.firstName = firstName;
    }
  
    public String getMi() {
      return mi;
    }
  
    public void setMi(String mi) {
      this.mi = mi;
    }
  
    public String getGender() {
      return gender;
    }
  
    public void setGender(String gender) {
      this.gender = gender;
    }
  
    public String getMajor() {
      return major;
    }
  
    public void setMajor(String major) {
      this.major = major;
    }
  
    public String[] getMinor() {
      return minor;
    }
  
    public void setMinor(String[] minor) {
      this.minor = minor;
    }
  
    public String[] getHobby() {
      return hobby;
    }
  
    public void setHobby(String[] hobby) {
      this.hobby = hobby;
    }
  
    public String getRemarks() {
      return remarks;
    }
  
    public void setRemarks(String remarks) {
      this.remarks = remarks;
    }
  
    public String getResponse() {
      if (lastName == null)
        return ""; // Request has not been made
      else {
        String allMinor = "";
        for (String s: minor) {
          allMinor += s + " ";
        }
  
        String allHobby = "";
        for (String s: hobby) {
          allHobby += s + " ";
        }
  
        return "&lt;p style=\"color:red\"&gt;You entered &lt;br /&gt;" + 
           "Last Name: " + lastName + "&lt;br /&gt;" + 
           "First Name: " + firstName + "&lt;br /&gt;" + 
           "MI: " + mi + "&lt;br /&gt;" +
           "Gender: " + gender + "&lt;br /&gt;" + 
           "Major: " + major + "&lt;br /&gt;" + 
           "Minor: " + allMinor + "&lt;br /&gt;" + 
           "Hobby: " + allHobby + "&lt;br /&gt;" + 
           "Remarks: " + remarks + "&lt;/p&gt;"; 
      }
    }
  }
  </code></pre>