how to getting multiple checkboxes values without using array

hi everybody,

my problem is when i want to get some value in a java file as:

String Worldwide=request.getParameter("Worldwide"); //checkbox

String America=request.getParameter("America"); //checkbox

if(Worldwide!=null)

{

if(Worldwide.equals("on"))

{

//some code here

}

}

if(America!=null)

{

if(America.equals("on"))

{

//some code here

}

}

is this code ok? it does not give me proper result.

but using following code i get the result :

1st give all checkboxes same name but different values and then.

String shiplocations[]=request.getParameterValues("shiplocation");

then getting the values from this array of string.

is there any way to get the values without using getParameterValues(..)?

can anyone help me?

[861 byte] By [suman_eaglea] at [2007-11-27 6:01:29]
# 1
There is no other way.Why do you want to avoid getParameterValues()? The answer on this is just your actual problem. If you don't know how to loop throug arrays or if you don't know how to convert an array to a few strings, then just ask this specific question.
BalusCa at 2007-7-12 16:41:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
i thought there sud b a way by checking the null values of the check box...and i got a long code. so i hav to replace all the code and also the forms.thanks for ur info.
suman_eaglea at 2007-7-12 16:41:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Just refactor duplicate code.
BalusCa at 2007-7-12 16:41:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...