How to call a Servlet when I click on a Hyperlink
On a JSP Page I have populated a table with some id's. I have made these ID's as hyperl开发者_如何学编程ink. Now i want that if I click on any id it should go to a servlet and that particular id should also be passed to the servlet.
Use this code in your JSP:
<a href="<%=request.getContextPath() %>/servlet-url?id=<%=id %>">...</a>
to create a link which invokes the servlet at /servlet-url
and passes the ID in the request parameter id
.
精彩评论