如何查看哪个<a> tag has been clicked from jsp on a servlet

时间:2017-06-12 19:59:58

标签: jsp

I have a jsp page with anchor below:

<a href ="servletpage"> Delete   <a/>
<a href = "servletpage"> Update<a/>

As a result of what link the user clicks, either an update or delete will be called from the servlet. Does anyone know how we can perform the above? I also need to send the attributes which are in my form to the servlet - without using submit button from my form as the submit button is already redirecting to a servlet performing add record operation.

1 个答案:

答案 0 :(得分:0)

您需要使用不同的方法来处理两个操作。

<a href="servlet?action='delete'"> Delete</a>
<a href="servlet?action='update'"> Update</a>

像这样。

希望这有帮助!