I am getting Array index out of bound exception so please help in solving the error int i; String loca=new String; if(request.getParameter("location") != null) loca = request.getParameterValues("location");
with the specification "loca[i]", you try to use an array element with an index number 0... An array cant have 0th element... Its because, at the beginning of your for loop, your index i is starting with the value 0... I think, somehow you must avoid using 0th element in the array.. Then the problem drops automatically
BTW, an array index out of bounds expception actually report the index of the member that is being accessed, when it is printed. You can use this as a way to figure out why the logic is trying to deference an invalid member.