1
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>成功提示</title>
</head>
<body>
操作成功!
</body>
</html>2
//编辑商品提交(更新)
@RequestMapping("/editItemsSubmit")
public String editItemsSubmit(HttpServletRequest request,Integer id,ItemsCustom itemsCustom)
throws Exception {
//调用service更新商品信息,页面需要将商品信息传到此方法
itemsService.updateItems(id, itemsCustom);
return "success";
}3
public void updateItems(Integer id,ItemsCustom itemsCustom) throws Exception; @Override
public void updateItems(Integer id, ItemsCustom itemsCustom) throws Exception {
itemsCustom.setId(id);
itemsMapper.updateByPrimaryKeyWithBLOBs(itemsCustom);
}4
int updateByPrimaryKeyWithBLOBs(Items record); <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.itcast.ssm.po.Items" >
update items
set name = #{name,jdbcType=VARCHAR},
price = #{price,jdbcType=REAL},
pic = #{pic,jdbcType=VARCHAR},
createtime = #{createtime,jdbcType=TIMESTAMP},
detail = #{detail,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>5
6
本文介绍了一个基于Java的商品信息编辑及更新流程,通过示例代码详细展示了从用户界面提交商品信息到后台处理的具体实现过程,包括控制器(Controller)如何接收请求参数、调用服务层更新商品信息以及返回处理结果。
262

被折叠的 条评论
为什么被折叠?



