I currently have the following in a jsp file:
<c:choose>
<c:when test = "${fn:length(song.songInfo) > 0}">
<form action='cart' method='POST'>
<table style="width:1000px" style="text-align:center">
<tr>
<th>Song Title</th>
<th>Song Artist</th>
<th>Album Title</th>
<th>Genre</th>
<th>Publisher</th>
<th>Year</th>
<th>Price</th>
<th>Select ?</th>
</tr>
<c:forEach var="item" items="${song.songInfo}">
<c:set var="split" value="${fn:split(item,';')}" />
<tr>
<td>${split[0]}</td>
<td>${split[1]}</td>
<td>${split[2]}</td>
<td>${split[3]}</td>
<td>${split[4]}</td>
<td>${split[5]}</td>
<td>${split[6]}</td>
<td>${split[7]}</td>
<td><input type="checkbox" name="songInfo" value="${split[0]} "></td>
</tr>
</c:forEach>
</table>
<input type="submit" value="Add to Cart"/>
</form>
</c:when>
<c:otherwise>
<p>No results found</p>
</c:otherwise>
</c:choose>
I want to send the <td> items to a Java servlet IF the corresponding checkbox for the row that has been ticked.
I'm using strCheckBoxValue = request.getParameter("songInfo"); in my servlet but this will only retrieve one string.
Could someone suggest a way that I could send all the information to the servlet for any number of rows in the table WITHOUT using javascript/JQuery?
Thank you for your help.