Reputation: 1
I am retrieving the set of values inside a table from database in a jsp page then it is in the form of link. Now I want to click that value and move to another jsp page.
How to code the program so that it can recognise that value and it can move to the next desired page.
But I unable to do that.
please help me....
Upvotes: 0
Views: 73
Reputation: 597382
Well, the steps are something like:
ResultSet
and add each link to a java.util.List
Link
that has two fields - the href, and the text value.doGet()
method of a servlet - when you have the List
, place it in the request using request.setAttribute("links", linksList)
request.getRequestDispatcher("yourPage.jsp").forward()
;On the page use JSTL to do the following:
<c:forEach items="${links}" var="link">
<a href="${link.href}">${link.text}</a>
</c:forEach>
Upvotes: 1