开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜