java - Not able to get values of checkboxes populated through JSP -



java - Not able to get values of checkboxes populated through JSP -

i associating checkbox each row in table. want selected checkboxes in servlet. have populated checkboxes this:

<%int i=0; %> <c:foreach items="${booklist}" var="book" varstatus="bookcount"> <tr> <td><input type="checkbox" name="bookselected" id="bookselected<%=i%>" value="<%=i%>"><c:out value="${book.title}"></c:out></td> <%i=i+1%> </c:foreach>

servlet code is

string[] chks = request.getparametervalues("bookselected");

the checkboxes displayed on screen though select checkboxes, servlets variable chks gets null value.

you need check few things here.

are check boxes within form beingness submitted ?.

you generating row each check box. so, table should within form tag beingness submitted.

now days, can check parameters submitted using tools "firebug" in firefox.

see if parameters getting passed name "bookselected".

java jsp servlets

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -