⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showproductinfo_0002ejsp_jsp.java

📁 JAVA数据库编程实例随书源码 JAVA数据库编程实例随书源码
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class showProductInfo_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/showProductInfo.jsp";from=(13,0);to=(13,96)]
    // end

    static {
    }
    public showProductInfo_0002ejsp_jsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse  response)
        throws java.io.IOException, ServletException {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html; charset=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // begin [file="/showProductInfo.jsp";from=(0,2);to=(9,0)]
                
                /**
                 * Title:			商店购物管理系统的完整实现
                 * Description:			教学示范
                 * Copyright:			Copyright (c) 2003
                 * Company:			北京师范大学计算机系
                 * @author			孙一林
                 * @version			1.0
                 */
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(9,2);to=(10,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(10,48);to=(12,0)]
                out.write("\r\n<html>\r\n");

            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(12,30);to=(13,0)]
                out.write("\r\n");

            // end
            // begin [file="/showProductInfo.jsp";from=(13,0);to=(13,96)]
                shopmanagesystem.shopManageSystemBean shopManageBean = null;
                boolean _jspx_specialshopManageBean  = false;
                 synchronized (session) {
                    shopManageBean= (shopmanagesystem.shopManageSystemBean)
                    pageContext.getAttribute("shopManageBean",PageContext.SESSION_SCOPE);
                    if ( shopManageBean == null ) {
                        _jspx_specialshopManageBean = true;
                        try {
                            shopManageBean = (shopmanagesystem.shopManageSystemBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "shopmanagesystem.shopManageSystemBean");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"shopmanagesystem.shopManageSystemBean", exc);
                        }
                        pageContext.setAttribute("shopManageBean", shopManageBean, PageContext.SESSION_SCOPE);
                    }
                 } 
                if(_jspx_specialshopManageBean == true) {
            // end
            // begin [file="/showProductInfo.jsp";from=(13,0);to=(13,96)]
                }
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(13,96);to=(13,98)]
                out.write("  ");

            // end
            // begin [file="/showProductInfo.jsp";from=(13,100);to=(13,129)]
                /*使用shopManageSystemBean的实例*/
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(13,131);to=(20,0)]
                out.write("\r\n<head>\r\n<title>修改商品信息</title>\r\n</head>\r\n<body>\r\n<h1 align=\"center\">修改商品信息</h1>\r\n<p>\r\n");

            // end
            // begin [file="/showProductInfo.jsp";from=(20,2);to=(24,0)]
                
                  int product_id = Integer.parseInt(new String(request.getParameter("updateProductID").getBytes("8859_1")));  //获取用户指定显示的库存商品的商品ID号
                  ResultSet rs =shopManageBean.getProductInfo(product_id);     //获取指定ID号的库存商品的信息
                  rs.next();
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(24,2);to=(25,0)]
                out.write("\r\n");

            // end
            // begin [file="/showProductInfo.jsp";from=(25,2);to=(25,25)]
                /*在文本框中显示指定ID号的库存商品信息*/
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(25,27);to=(26,56)]
                out.write("\r\n<form method=\"post\" action=\"updateProduct.jsp?productID=");

            // end
            // begin [file="/showProductInfo.jsp";from=(26,59);to=(26,69)]
                out.print(product_id);
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(26,71);to=(31,53)]
                out.write("\">\r\n  <table width=\"75%\" border=\"0\" align=\"center\">\r\n    <tr>\r\n      <td align=\"center\">商品名称:</td>\r\n      <td align=\"center\">\r\n        <input type=\"text\" name=\"productName\" value=\"");

            // end
            // begin [file="/showProductInfo.jsp";from=(31,56);to=(31,84)]
                out.print(rs.getString("product_name"));
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(31,86);to=(37,54)]
                out.write("\">\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"center\">商品价格:</td>\r\n      <td align=\"center\">\r\n        <input type=\"text\" name=\"productPrice\" value=\"");

            // end
            // begin [file="/showProductInfo.jsp";from=(37,57);to=(37,86)]
                out.print(rs.getString("product_price"));
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(37,88);to=(43,57)]
                out.write("\">\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"center\">商品数量:</td>\r\n      <td align=\"center\">\r\n        <input type=\"text\" name=\"productQuantity\" value=\"");

            // end
            // begin [file="/showProductInfo.jsp";from=(43,60);to=(43,92)]
                out.print(rs.getString("product_quantity"));
            // end
            // HTML // begin [file="/showProductInfo.jsp";from=(43,94);to=(54,0)]
                out.write("\">\r\n      </td>\r\n    </tr>\r\n  </table>\r\n  <p align=\"center\">\r\n    <input type=\"submit\" name=\"Submit\" value=\"确定\">\r\n    <input type=\"reset\" value=\"重填\">\r\n  </p>\r\n  </form>\r\n</body>\r\n</html>\r\n");

            // end

        } catch (Throwable t) {
            if (out != null && out.getBufferSize() != 0)
                out.clearBuffer();
            if (pageContext != null) pageContext.handlePageException(t);
        } finally {
            if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
        }
    }
}

⌨️ 快捷键说明

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