In JSP, request.getParameter(x) returns a null value if x is integer.So what to use to get integer value of x?

x cannot be integer:

<input type="text" name="1">
String value = request.getParameter("1");

"1" is a String

Now if you want the VALUE to be taken as an integer:

<input type="text" name="textName" value="123">
String value = request.getParameter("textName");
int intValue = Integer.parseInt(value);

At the last example, the textfield can have any value you enter when you submit the form. So the above code might throw an NumberFormatException if you don't enter a number, or the request.getParameter("textName") might return null if that tetxFiled didn't send any info with at the request.
So don't forget to make the necessary checks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.