Reputation: 3681
I'm using a JSP page that displays a list of "festival names". I want to then link to a page on click which will show the "profile page" of that festival. how do i send which link was clicked to the JAVA SERVLET so that i can use SQL and Java to send the chosen information to the "profile page" jsp.
<table border ="1">
<tr>
<td>Festival Name:</td>
<td>Location:</td>
<td>Start Date:</td>
<td>End Date:</td>
<td>URL:</td>
<td>List of Trips to </td>
</tr>
<c:forEach items="${allFestivals}" var="festival">
<tr>
<td>${festival.festivalName}</td>
<td>${festival.location}</td>
<td>${festival.startDate}</td>
<td>${festival.endDate}</td>
<td>${festival.URL}</td>
<td><a href="festival_profile.jsp">View Your Festivals</a></td>
^i have the festivals ID that can be sent with this link in the jsp
</tr>
</c:forEach>
I simple need to know how to send the chosen "festival" ID back to the servlet so it can generate the profile JSP. EDIT : and how to catch it on the servlet
Upvotes: 1
Views: 1474
Reputation: 1
Use the link
<a href="<c:url value="/servletpath"><c:param name="id" value="${festival.id}"/></c:url>">View Your Festivals</a>
Upvotes: 1