title: java.lang.NumberFormatException: null with Integer.Parseint()
body: <p>*when I try to run my JSP on the server I encounter this problem...
  the servlet is:</p>
  
  <pre><code>@WebServlet({"/Registrazione" , "/Registrazione.jsp"})
  public class Registrazione extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
      public Registrazione() {
          super();
          // TODO Auto-generated constructor stub
      }
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
  
          ClienteDAO d=new ClienteDAO();
  
          String idCliente=request.getParameter("userid");
          String nome=request.getParameter("nome");
          String cognome=request.getParameter("cog");
          String partitaIva=request.getParameter("piva");
          String codiceFiscale=request.getParameter("cf");
          String email=request.getParameter("eml");
          String fidelity=request.getParameter("fid");
          String via=request.getParameter("via");
          String numerocivico = request.getParameter("nciv");
          String password=request.getParameter("pw");
  
  
  
          Cliente cliente=new Cliente(Integer.parseInt(idCliente),nome,cognome,partitaIva,codiceFiscale, email,Integer.parseInt(fidelity),via,Integer.parseInt(numerocivico),password);
  
          d.salvaCliente(cliente);
  
          response.getWriter().append("utente registrato").append(request.getContextPath());
      }
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          doGet(request, response);
      }
  </code></pre>
  
  <p>and the JSP is</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Registrazione&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="/Registrazione" name="FormRegistrazione" method="get" &gt;
  Username:&lt;input type="text" name="userid" value=""&gt;
  &lt;br&gt;
  Nome:&lt;input type="text" name="nome" value=""&gt;
  &lt;br&gt;
  Cognome:&lt;input type="text" name="cog" value=""&gt;
  &lt;br&gt;
  PIVA:&lt;input type="text" name="piva" value=""&gt;
  &lt;br&gt;
  CF:&lt;input type="text" name="cf" value=""&gt;
  &lt;br&gt;
  email:&lt;input type="text" name="eml" value=""&gt;
  &lt;br&gt;
  fidelity:&lt;input type="text" name="fid" value=""&gt;
  &lt;br&gt;
  via:&lt;input type="text" name="via" value=""&gt;
  &lt;br&gt;
  civico:&lt;input type="text" name="nciv" value=""&gt;
  &lt;br&gt;
  password:&lt;input type="text" name="pw" value=""&gt;
  &lt;br&gt;
  &lt;input type="submit" value="invia"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  }*
  </code></pre>
  
  <p>but when i try to run the jsp from server i see this :</p>
  
  <pre><code>HTTP Status 500 – Internal Server Error
  
  
  Type Exception Report
  
  Message null
  
  Description The server encountered an unexpected condition that prevented it from fulfilling the request.
  
  Exception
  java.lang.NumberFormatException: null
  java.lang.Integer.parseInt(Unknown Source)
  java.lang.Integer.parseInt(Unknown Source)
  it.unirc.twd.BuyeDrink.servlet.NuovoCliente.doGet(NuovoCliente.java:37)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  
  
  Note The full stack trace of the root cause is available in the server logs.
  </code></pre>
  
  <p>I have a similar servlet and it run very good but also with "" value in the form.
  So I can't understand the problem with integer parseInt ... what's the problem?</p>