insertproduct.jsp

来自「JAVA数据库编程实例随书源码」· JSP 代码 · 共 30 行

JSP
30
字号
<%
/**
 * Title:			商店购物管理系统的完整实现
 * Description:			教学示范
 * Copyright:			Copyright (c) 2003
 * Company:			北京师范大学计算机系
 * @author			孙一林
 * @version			1.0
 */
%>
<%@ page contentType="text/html; charset=GBK" %>
<html>
<%@ page import="java.sql.*"%>
<jsp:useBean id="shopManageBean" scope="session" class="shopmanagesystem.shopManageSystemBean"/>  <%/*使用shopManageSystemBean的实例*/%>
<head>
<title>插入新的商品成功</title>
</head>
<body>
<%
  int productID = Integer.parseInt(new String(request.getParameter("productID").getBytes("8859_1")));  //获取要插入商品的ID号
  String productName = new String(request.getParameter("productName").getBytes("8859_1"));             //获取要插入商品的商品名称
  int productPrice = Integer.parseInt(new String(request.getParameter("productPrice").getBytes("8859_1")));  //获取要插入商品的商品价格
  int productQuantity = Integer.parseInt(new String(request.getParameter("productQuantity").getBytes("8859_1")));   //获取要插入商品的商品数量
  shopManageBean.insertNewProduct(productID, productName, productPrice, productQuantity);           //向库存商品表中插入新的商品信息
  out.println("<h2 align=center>插入新的商品信息成功</h2>");
  out.println("<p align=center><a href=productList.jsp>返回</a></p>");
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?