Hi there,
I am a complete newbie to JSP so apologies if this is a blindingly obvious question - I have researched on Google, but can't get this working.
I have a simple switch statement as below:
<%
for (int a=0; a<10; a++) {
if ( null != countryID[a] ) {
int country = countryID[a];
switch(country) {
case 8:
out.println("Case 8");
break;
case 13:
out.println("Case 13");
break;
default:
out.println("Default case");
}
}
}
%>
If I set the country integer manually (e.g. int country = 18;) the statement works fine, however If I try to grab the integer from countryID[a] (which is necessary to make the switch dynamic) then it doesn't work.
I'd be most grateful for any advice.