jsp tags - JSP cannot parse form input to integer -


i have vector magazines keep titles of magazines. created form people can choose magazines want.

...  <form action="magform.jsp"> <table> <% vector magazines; //already populated titles  for(int = 0; < magazines.size(); i++) { %>     <tr>         <td>             <input type="checkbox" name="mags" value="<%=i%>">             <%out.println(magazines.get(i)); %><br />         </td>     </tr> <% } %> <input type="submit" value="submit"> </table></form>  <% string select[] = request.getparametervalues("mags");  for(int = 0; < select.length; i++) {     out.println(select[i]); } %> 

for above codes, can result of select. when modify to:

<% string select[] = request.getparametervalues("mags"); int a; for(int = 0; < select.length; i++) {     = integer.parseint(select[i]);     out.println(a); }  %> 

it gives me error message: input string "on". why can't parse string array integer?


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

node.js - Node - Passport Auth - Authed Post Route hangs on form submission -

Does Firefox offer AppleScript support to get URL of windows? -