title: Avoid default int value of 0 to display in h:inputText
body: <p>i understand from similar question on the site that to avoid the default value i have to use wrapper class, so i changed my int to Integer but then i am getting nullpointerexception, i thought if u pass a null value to jsf it just shows it as an empty field. i am using glassfish 4.0. i am unable to understand why i am getting this exception</p>
  
  <p>following is the exception i am getting</p>
  
  <pre><code>javax.el.ELException: /index.xhtml @23,66 value="#{userIdea.idea.empid}": java.lang.NullPointerException
  at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
  at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
  at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
  at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
  at javax.faces.component.UIInput.getValue(UIInput.java:291)
  at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
  at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
  at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
  at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
  at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
  at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
  at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
  at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
  at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
  </code></pre>
  
  <p>The following is my jsf code snippet</p>
  
  <pre><code>Employee ID:
  &lt;h:inputText value="#{userIdea.idea.empid}" required="true"
              requiredMessage="You must enter a Employee ID"
              converterMessage="Employee ID must be a number" id="empid" /&gt;
  </code></pre>
  
  <p>Idea class snippet</p>
  
  <pre><code> private Integer empid;
  public int getEmpid() {
      return empid;
  }
  public void setEmpid(int empid) {
      this.empid = empid;
  }
  </code></pre>