我可以使用錨標籤提交表單嗎?在這段代碼中,我使用了一個標準提交按鈕,但是如何使用錨定標記<a href=Cart?removeId=${cartItem.productId>Remove</a>
使用錨鏈接進行表單提交
我試過了,但是在servlet中調用了doGet()方法。我想顯然調用doPost()方法。所以我可以使用更好的方法。
<c:forEach items="${lstCart}" var="cartItem" varStatus="count">
<form action="Cart" method=Post>
<tr height="40px">
<td>${count.count}</td>
<td>${cartItem.productName}</td>
<td>${cartItem.quantity}</td>
<td>${cartItem.unitPrice}</td>
<td>${cartItem.totalPrice}</td>
<td>
<input type="hidden" name="id" value="${cartItem.productId}" />
<input type=submit value="x"></td>
</tr>
</form>
</c:forEach>