convert string to integer

by Nirmala 2008-05-13 11:34:18

Hi..

Get some value from HTML element in jsp file means use the getParameter() method.To convert from string to integer use the following code.

For example get some count value.

String count1=request.getParameter("count");
int total;
if(count1!=null)
total=Integer.parseInt(count1);


count->textbox name
count1->string variable.
total->integer variable.

Tagged in:

2453
like
1
dislike
1
mail
flag

You must LOGIN to add comments