title: NumberFormatException while converting from string to integer in servlet
body: <p>I know ths is a common question here. I have read the solutions and modified the code then also i am not getting the solution so I have posted my code here.</p>
  
  <p>when I read a value from the text box and parse the value into int from String in servlet, why does it show NumberFormatException?</p>
  
  <pre><code>  String ph=request.getParameter("phone");
    int phone=Integer.parseInt(ph.trim());// exception is generated here
  </code></pre>