cast强制转换
exception异常
implement实现
Select:
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品列表</title>
</head>
<body>
<table border="solid 1px red;" cellspacing="0px" cellpadding="5px" width="600px" >
<thead>
<tr style="text-align: left;">
<form action="insert.jsp" method="post" enctype="application/x-www-form-urlencoded">
<td colspan="3">
<input type="submit" value="添加"/>
</td>
</form>
<form action="delete.jsp" method="post" enctype="application/x-www-form-urlencoded">
<td colspan="3">
<input type="submit" value="删除"/>
</td>
</form>
</tr>
<tr style="text-align: center;">
<td><input type="checkbox" id="checkAll"/></td>
<th>商品ID</th>
<th>商品编号</th>
<th>商品名称</th>
<th>商品价格</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${ list }" var="p">
<tr style="text-align: center;">
<td><input type="checkbox" class="checkSimple" value="${ p.gds_id }"/></td>
<th>${ p.gds_id }</th>
<th>${ p.gds_no }</th>
<th>${ p.gds_name }</th>
<th>${ p.gds_price }</th>
<td><a href="update.jsp">修改</a></td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>
Update:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改</title>
</head>
<body>
<form action="update" method="post" enctype="application/x-www-form-urlencoded">
<table border="solid 1px red;" cellspacing="0px" cellpadding="5px" width="600px" >
<thead>
<tr style="text-align: center;">
<td><input type="checkbox" id="checkAll"/></td>
<th>商品id</th>
<th>商品名称</th>
<th>商品价格</th>
<th>商品操作</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" class="checkSimple"/></td>
<td><input type="text" name="gds_id" id="gds_id"></td>
<td><input type="text" name="gds_name" id="gds_name"></td>
<td><input type="text" name="gds_price" id="gds_price"></td>
<td><input type="submit" id="update" value="修改"/></td>
</tr>
</tbody>
</table>
<p style="color: red">${update}</p>
<a href="/select">返回</a>
</form>
</body>
</html>