java.lang.NumberFormatException: For input string: ""
this is how my Java code looks like:
int age=Integer.parseInt(request.getParameter("age"));
If request parameter age
is empty, not a number, or missing altogether, you cannot convert it to a number.
You'll have to decide what to do in such situation, then do it in the cases mentioned above, i.e.:
try { ... } catch (NumberFormatException e) { ... }