在JavaScript中想要调用Java的方法,通过JavaScript访问servlet,再通过servlet调用Java某个类的方法。
HTML代码
<table id="cartTable">
<thead>
<tr>
<th class="product_remove">
<label>
<input class="check-all check" type="checkbox"/> 全选
</label>
<a class="fl delete" id="deleteAll" href="javascript:;"><i class="fa fa-trash-o"></i></a>
</th>
<th class="product_thumb">图片</th>
<th class="product_name">名称</th>
<th class="product-price">价格</th>
<th class="product_quantity">款式</th>
</tr>
</thead>
<tbody>
<tr>
<td class="product_remove">
<input class="check-one check" type="checkbox"/>
</td>
<td class="product_thumb">
<a href="ShopShoesDetails.jsp?shoes_id=<%=shoes.getShoes_id() %>">
<img src="${pageContext.request.contextPath}/ShopServlet?method=getShopsShoesImage&shoes_id=<%=shoes.getShoes_id() %>" alt="">
</a>
</td>
<td class="product_name">
<a href="ShopShoesDetails.jsp?shoes_id=<