This is part of a research project. I have a list that is iterated in the jsp page. I'm not able to get the value of the item in the list the user selects as it picks the first in the list when I retrieve it in the servlet. Any pointers or solution would be helpful.
I tried using [status.index]
to the name tag but there too I have no idea which index the user picked to get in the servlet.
<c:forEach items="${TSName}" var="TSName" varStatus="status">
<b>Resource Name:</b> ${TSName}<br>
<b>Summary:</b> ${Summary[status.index]}<br>
<b>URL: ${URL[status.index]}</b><br>
<b>Average Rating:</b> ${AvgRating[status.index]}<br>
<input type="hidden" value="${TSName}" name="tool" />
<input type="hidden" value=" ${URL[status.index]}" name="url" />
<input type="hidden" name="uuid" value="${requestScope.uuid}" />
<input type="submit" value="Proceed" /><br><br>
</c:forEach>
I would only want the exact item the user picks from the list instead of the first item of each. I'm sorry if I made it too confusing. If anything is unclear I can clarify.
@BalusC I'm sorry but you didn't answer anywhere close to my question. I had mentioned it a part of a research project and you just presumed the list of items were generated was based on a id. There were multiple conditions to get that list of items for the users. @Paul provided the most simplest and accurate answer to my question so if you could reopen the question I could mark his answer as the solution.
This item is selected!