title: Request processing failed; nested exception is java.lang.NumberFormatException: null
body: <p>I'm getting error as <code>Request processing failed; nested exception is java.lang.NumberFormatException: null</code>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code> @Controller
   @RequestMapping("/customerAdmin")
   public class CustomerAdmincontroller {
          @InitBinder
          public void initBinder(WebDataBinder binder) {
              binder.registerCustomEditor(Customer.class, "customer", new PropertyEditorSupport() {@
                  Override
                  public void setAsText(String customer) {
        setValue(new Customer(Integer.parseInt(customer)));
                  }
              });
          }
  
          @RequestMapping(value = "/addProfile.htm", method = RequestMethod.GET)
          public ModelAndView addProfileForm(ModelMap model, HttpServletRequest request) {
              int id = Integer.parseInt(request.getParameter("id"));
              System.out.println(id);
              Profile profile = new Profile();
              Customer customer = new Customer(id);
              profile.setCustomer(customer);
              model.addAttribute("profile", profile);
              ModelAndView mav = new ModelAndView("addProfile");
              return mav;
          }
  }
  </code></pre>
  
  <p>Am getting error as</p>
  
  <blockquote>
    <p>Oct 16, 2014 4:31:47 PM  invoke</p>
    
    <p>SEVERE: Servlet.service() for servlet [dispatcherServlet] in context
     with path [/CustomerPortal] threw exception [Request processing
     failed; nested exception is java.lang.NumberFormatException: null]
     with root cause</p>
  </blockquote>
  
  <p>when i run the project this error already show and i see this error in this Here but still it's error for me. any one can help me ?
  My controler :</p>
  
  <pre><code>@Autowired
      addozv stdDAO;
  
      private ServletRequest request;
      @SuppressWarnings({ "null"})  
            @RequestMapping(value="/addadmins" , method = RequestMethod.POST)
             public void addadmins(ModelMap model, HttpServletRequest requ) {
                 String username = requ.getParameter("username");
                 String password = requ.getParameter("password");
                 String nozv = requ.getParameter("nozv");
                 String namefamily = requ.getParameter("namefamily");
                 String codemely = requ.getParameter("codemely");
                 String father = requ.getParameter("father");
                 String adress = requ.getParameter("adress");
                 String telephone = requ.getParameter("telephone");
                 admins adm=new admins();
                 adm.setUsername(username);
                 adm.setPassword(password);
                 adm.setNozv(Integer.parseInt(nozv));
                 adm.setNamefamily(namefamily);
                 adm.setCodemely(Integer.parseInt(codemely));
                 adm.setFather(father);
                 adm.setAdress(adress);
                 adm.setTelephone(Integer.parseInt(telephone));  
                 stdDAO.add(adm);
  </code></pre>
  
  <p>Jdbc :</p>
  
  <pre><code>@Override
      public void add(admins adm) {
          String sql = "INSERT INTO admins " +
                  "username, password, nozv, namefamily, codemely, father, adress, telephone) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
          Connection conn = null;
          try{
              conn = dataSource.getConnection();
              PreparedStatement ps=conn.prepareStatement(sql);
              ps.setString(1, adm.getUsername());
              ps.setString(2, adm.getPassword());
              ps.setInt(3, adm.getNozv());
              ps.setString(4, adm.getNamefamily());
              ps.setInt(5, adm.getCodemely());
              ps.setString(6, adm.getFather());
              ps.setString(7, adm.getAdress());
              ps.setInt(8, adm.getTelephone());
              ps.executeUpdate();
              ps.close();
              } catch (SQLException e) {
                  throw new RuntimeException(e);
  
              } finally {
                  if (conn != null) {
                      try {
                  conn.close();
              } catch (SQLException e) {}
          }       
  }
  </code></pre>
  
  <p>and in jsp page it's true i don't know why already it's Error in this page.
  before this code i'm writing this code:</p>
  
  <pre><code>@SuppressWarnings("null")
     @RequestMapping(value="/addozvv" , method = RequestMethod.GET)
     public String addozv(ModelMap model) {
        model.addAttribute("title", "ozv");
  
  
        return "addozvv";
     }
  
     @SuppressWarnings("null")
     @RequestMapping(value="/addozvv" , method = RequestMethod.POST)
     public void showPageSaveozv(ModelMap model, HttpServletRequest req) {
         String Id = req.getParameter("nozviat");
         String namefamily = req.getParameter("namefamily");
         String codemely = req.getParameter("codemely");
         String father = req.getParameter("father");
         String adress = req.getParameter("adress");
         String otelephone = req.getParameter("otelephone");
         String znamefamily = req.getParameter("znamefamily");
         String zcodemely = req.getParameter("zcodemely");
         String office = req.getParameter("office");
         String ztelephone = req.getParameter("ztelephone");
  
        /////////////
        ozviat ozv = new ozviat();
  
        ozv.setId(Integer.parseInt(Id));   
        ozv.setNamefamily(namefamily); 
  
      ozv.setCodemely(Integer.parseInt(codemely));  
        ozv.setFather(father);   
        ozv.setAdress(adress);  
        ozv.setOtelephone(Integer.parseInt(otelephone));   
        ozv.setZnamefamily(znamefamily);   
        ozv.setZcodemely(Integer.parseInt(zcodemely));   
        ozv.setOffice(office); 
        ozv.setZtelephone(Integer.parseInt(ztelephone)); 
        stdDAO.insert(ozv);
  
  
     }
  </code></pre>
  
  <p>but when i Run the project it's ture but other one it's a error    </p>