📄 geaction.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>GoodsEditAction</title>
</head>
<body>
<jsp:directive.page import="com.eshop.dto.Goods"/>
<jsp:directive.page import="com.eshop.daoImpl.GoodsDaoImpl;"/>
<%
request.setCharacterEncoding("gb2312");
int id = Integer.parseInt(request.getParameter("id"));
Goods g = new Goods();
g.setId(id);
g.setBrand(request.getParameter("brand"));
g.setIntime(request.getParameter("intime"));
g.setIntroduc(request.getParameter("introduc"));
g.setNowprice(Double.parseDouble(request.getParameter("nowprice")));
g.setPrice(Double.parseDouble(request.getParameter("price")));
g.setType(request.getParameter("type"));
g.setPicture(request.getParameter("picture"));
GoodsDaoImpl gdi = new GoodsDaoImpl();
int flag = gdi.update(g);
if(flag != 0){
out.print("<script language='javascript'>alert('操作成功!');window.location.href('GoodsView.jsp');</script>");
}
else{
out.print("<script language='javascript'>alert('操作失败!');window.location.href('GoodsView.jsp');</script>");
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -