TablePagingController修改一条记录的解析: ...... } else if (strOper.equals("edit")) { // oper:edit String strId = request.getParameter("id"); int id = Integer.parseInt(strId); logger.info("Res-Host request id=[" + id + "]"); String strClientId = request.getParameter("client_id"); int clientId = Integer.parseInt(strClientId); logger.info("Res-Host request client_id=[" + clientId + "]"); String invdate = request.getParameter("invdate"); logger.info("Res-Host request invdate=[" + invdate + "]"); String closed = request.getParameter("closed"); logger.info("Res-Host request closed=[" + closed + "]"); String ship_via = request.getParameter("ship_via"); logger.info("Res-Host request ship_via=[" + ship_via + "]"); String note = request.getParameter("note"); logger.info("Res-Host request note=[" + note + "]"); String strAmount = request.getParameter("amount"); float amount = Float.parseFloat(strAmount); logger.info("Res-Host request amount=[" + amount + "]"); String strTax = request.getParameter("tax"); float tax = Float.parseFloat(strTax); logger.info("Res-Host request tax=[" + tax + "]"); String strTotal = request.getParameter("total"); float total = Float.parseFloat(strTotal); logger.info("Res-Host request total=[" + total + "]"); InvHeader data = new InvHeader(); data.setId(id); data.setInvdate(invdate); data.setClient_id(clientId); data.setAmount(amount); data.setTax(tax); data.setTotal(total); data.setClosed(closed); data.setShip_via(ship_via); data.setNote(note); final boolean b = this.getDao().update(data); model.put("JSON_OBJECT", b); ...... TablePagingDao修改一条记录的操作: ...... /** * 修改某对象信息. * * @param data * :InvHeader * @return true/false */ public boolean update(final InvHeader data) { JdbcTemplate jdbcTemplate = this.getJdbcTemplate(); String sql = "UPDATE invheader SET client_id=?, invdate=?, amount=?, tax=?, total=?, closed=?, ship_via=?, note=?" + " WHERE id=?"; jdbcTemplate.update(sql, new PreparedStatementSetter() { public void setValues(PreparedStatement ps) throws SQLException { ps.setInt(1, data.getClient_id()); ps.setString(2, data.getInvdate()); ps.setFloat(3, data.getAmount()); ps.setFloat(4, data.getTax()); ps.setFloat(5, data.getTotal()); ps.setString(6, data.getClosed()); ps.setString(7, data.getShip_via()); ps.setString(8, data.getNote()); ps.setInt(9, data.getId()); } }); return true; } ......