I've to display many groups and many products under each group. For displying them I'm using JSTL to iterate the list of products from the list of groups. User can select one product from each group by clicking on the radio. To enable this i've added the id of the group with the radio name, so that user can select multiple radios.
How can get the selected radios from the servlet? Because the name is created dynamically.
<c:forEach items="${pgb.tableValues}" var="tv">
<tr>
<c:forEach items="${tv}" var="tvalue">
<c:if test="${tvalue.type != null && not empty(tvalue.type)}">
<td>
<c:if test="${tvalue.type=='radio'}">
<input type="radio" value="${tvalue.id}" name="selectedProd${pgb.id}"/>
</c:if>
<c:if test="${tvalue.image != null}">
<img src="${tvalue.image}" alt="image"/>
</c:if>
${tvalue.text}
</td>
</c:if>
</c:forEach>
</tr>
</c:forEach>
or is there some better way to do this?