アイテムがテーブルの行として表示されるショッピングカートアプリケーションがあります。各行の終わりには、「カートに追加」送信ボタンがあります。現在、そのボタンをクリックすると、ページ全体が消え、フォームがサーブレットに送信されるときにエラー404ページが表示されます。私が欲しいのは、1つの行が送信されると、残りの行が残り、クリックされた行だけが色を変えることです。ユーザーがさらに行(アイテム)を追加すると、それらの各行の色が変わるはずです。色が変わる部分がありますが、残りの行をページに残す方法がわかりません。
<h1> Here is the product list as per your category selection</h1>
<table cellpadding="10" border="1" id="tbl">
<tr valign="bottom" style="background-color: #FF00FF">
<th align="left">Sl No</th>
<th align="left">Prod ID</th>
<th align="left">Unit Price</th>
<th align="left">Quantity</th>
<th align="left"></th>
</tr>
<form name="tableForm" >
<c:forEach items="${listInServlet1}" var="regBean">
<tr style="background-color: #00FFFF">
<input type="hidden" value="sval" name="qtyTextHidden" />
<input type="hidden" name="reagentId" value="<c:out Value = " ${regBean.prodId}
"/>" />
<td>
<c:out Value="${regBean.prodCount}" />
</td>
<td>
<c:out Value="${regBean.prodId}" />
</td>
<td>
<c:out Value="${regBean.price}" />
</td>
<td>
<input name="qtyText" type="text" size="2" value=""
onChange="calculateTotalPrice(this, '${regBean.price}')"
/>
</td>
<td>
<input name="totalprice" type="text" size="2" value="0" />
</td>
<td>
<input type="submit" value="Add to Cart" name="addToCrtBtn"
onClick="submitValues(event, '${regBean.prodCount}', '${regBean.price}')"
/>
</td>
</tr>
</c:forEach>
</form>
</table>
<table>
<tr>
<td>
<form name="tableForm" method="post" action="/myapp/myservlet">
<input type="submit" value="Done" id="submitOrder" />
</form>
</td>
</tr>
</table>