<c:forEach items="${itemList }" var="item"> <tr> <td><input name="ids" value="${item.id}" type="checkbox"></td> <td>${item.name }</td> <td>${item.price }</td> <td><fmt:formatDate value="${item.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td> <td>${item.detail }</td> <td><a href="${pageContext.request.contextPath }/itemEdit.action?id=${item.id}">修改</a></td> </tr> </c:forEach> |
<table width="100%" border=1> <tr> <td>商品名称</td> <td>商品价格</td> <td>生产日期</td> <td>商品描述</td> <td>操作</td> </tr> <tr> <td><input name="ids" value="1" type="checkbox"></td> <td>台式机</td> <td>3000.0</td> <td>2016-02-03 13:22:53</td> <td></td> <td><a href="/springmvc-web/itemEdit.action?id=1">修改</a></td> </tr> <tr> <td><input name="ids" value="2" type="checkbox"></td> <td>笔记本</td> <td>6000.0</td> <td>2015-02-09 13:22:57</td> <td></td> <td><a href="/springmvc-web/itemEdit.action?id=2">修改</a></td> </tr> <tr> <td><input name="ids" value="3" type="checkbox"></td> <td>背包</td> <td>200.0</td> <td>2015-02-06 13:23:02</td> <td></td> <td><a href="/springmvc-web/itemEdit.action?id=3">修改</a></td> </tr> </table> |
@RequestMapping("/queryitem") public String queryItem(QueryVo queryVo, String[] ids) { System.out.println(queryVo.getItems().getName()); System.out.println(queryVo.getItems().getPrice()); System.out.println(ids.toString()); return null; } |
<c:forEach items="${itemList }" var="item"> <tr> <td><input name="ids" value="${item.id}" type="checkbox"></td> <td> <input name="id" value="${item.id}" type="hidden"> <input name="name" value="${item.name }" type="text"> </td> <td><input name="name" value="${item.price }" type="text"></td> <td><input name="name" value="<fmt:formatDate value="${item.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>" type="text"></td> <td><input name="name" value="${item.detail }" type="text"></td> <td><a href="${pageContext.request.contextPath }/itemEdit.action?id=${item.id}">修改</a></td> </tr> </c:forEach> |
@RequestMapping("/queryitem") public String queryItem(QueryVo queryVo, String[] ids) { System.out.println(queryVo.getItems().getName()); System.out.println(queryVo.getItems().getPrice()); System.out.println(ids.toString()); return null; } |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |