0

I wrote a java servlet program but when i run it, It was showing the Error HTTP Status 500 - null What it means ; My source code is on this page.

The error was

HTTP Status 500 - null
type Exception report
message null
description The server encountered an internal error that prevented it from fulfilling this request.
exception
 java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
skypark.Registration.doPost(Registration.java:56)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

Please help me to resolve this....

Community
  • 1
  • 1

4 Answers4

2

possibly

int phone=Integer.parseInt(phone1);

phone1 is null passed

jmj
  • 237,923
  • 42
  • 401
  • 438
0

hey correct ur html there is no input type =number just correct as follows

Phone Number
</td><td>
<input type="text" name="phone">
</td></tr><tr><td>
Nipun Jain
  • 626
  • 4
  • 6
0

From the error I can say that there is something other than a numberpassed to your function and this exception is raised.

Something like this:

int a = Integer.ParseInt(aStr);

where the aStr is abc

Matin Kh
  • 5,192
  • 6
  • 53
  • 77
0

You should have attribute name in the input tag.

<input type="text" name="xyz">

In d servlet access the value after parsing it, as follows.

int x=Integer.parseInt(request.getParameter("xyz"));
psubsee2003
  • 8,563
  • 8
  • 61
  • 79
Tweety
  • 1
  • 1