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

📄 sale_0002ejsp_jsp.java

📁 一个实用的超市系统
💻 JAVA
字号:
import jxc.ConnectionManager;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class sale_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public sale_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=gb2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

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

            // HTML // begin [file="/sale.jsp";from=(0,122);to=(6,0)]
                out.write("\r\n<html>\r\n<head>\r\n<title>销售</title>\r\n</head>\r\n<body>\r\n");

            // end
            // HTML // begin [file="/header.jsp";from=(0,0);to=(16,0)]
                out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n        <tr align=\"center\"> \r\n          <td height=\"100\" colspan=\"5\"><font size=\"+3\">小型超市进销存系统</font></td>\r\n        </tr>\r\n        <tr align=\"center\"> \r\n          <td width=\"25%\"><a href=\"buy.jsp\">进货登记</a></td>\r\n          <td width=\"25%\"><a href=\"sale.jsp\">销售登记</a></td>\r\n          <td width=\"25%\"><a href=\"resQuery.jsp\">库存查询</a></td>\r\n          <td width=\"25%\"><a href=\"logout.jsp\">退出</a></td>\r\n          <td width=\"25%\">&nbsp;</td>\r\n        </tr>\r\n      </table></td>\r\n  </tr>\r\n</table>\r\n");

            // end
            // HTML // begin [file="/sale.jsp";from=(6,32);to=(17,0)]
                out.write("\r\n<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n  <tr>\r\n    <td><form action=\"/jxc/saleservlet.do\" method=\"post\">\r\n        <table width=\"80%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\">\r\n          <tr align=\"center\"> \r\n            <td colspan=\"2\">销售</td>\r\n          </tr>\r\n          <tr> \r\n            <td width=\"256\" align=\"right\">商品名称</td>\r\n            <td width=\"384\"><select name=\"wareID\">\r\n");

            // end
            // begin [file="/sale.jsp";from=(17,2);to=(27,0)]
                
                    Connection conn = null;
                    PreparedStatement stmt = null;
                    ResultSet rs = null;
                
                    conn = ConnectionManager.getConnection();
                    stmt = conn.prepareStatement("select * from Ware");
                
                    rs = stmt.executeQuery();
                    while (rs.next()) {
            // end
            // HTML // begin [file="/sale.jsp";from=(27,2);to=(28,31)]
                out.write("\r\n                <option value=\"");

            // end
            // begin [file="/sale.jsp";from=(28,34);to=(28,56)]
                out.print(rs.getString("wareID"));
            // end
            // HTML // begin [file="/sale.jsp";from=(28,58);to=(28,60)]
                out.write("\">");

            // end
            // begin [file="/sale.jsp";from=(28,63);to=(28,87)]
                out.print(rs.getString("wareName"));
            // end
            // HTML // begin [file="/sale.jsp";from=(28,89);to=(29,0)]
                out.write("</option>\r\n");

            // end
            // begin [file="/sale.jsp";from=(29,2);to=(34,0)]
                
                    }
                	rs.close();
                	stmt.close();
                	conn.close();
            // end
            // HTML // begin [file="/sale.jsp";from=(34,2);to=(58,0)]
                out.write("\r\n              </select>\r\n              </td>\r\n          </tr>\r\n          <tr> \r\n            <td align=\"right\">销售价格</td>\r\n            <td><input name=\"salePrice\" type=\"text\" id=\"salePrice\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td align=\"right\">销售数量</td>\r\n            <td><input name=\"saleQty\" type=\"text\" id=\"saleQty\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td align=\"right\">销售时间(格式如2003-5-20)</td>\r\n            <td><input name=\"saleDate\" type=\"text\" id=\"saleDate\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td>&nbsp;</td>\r\n            <td><input type=\"submit\" name=\"Submit\" value=\"确定\"> <input type=\"reset\" name=\"Submit2\" value=\"清空\"></td>\r\n          </tr>\r\n        </table>\r\n      </form></td>\r\n  </tr>\r\n</table>\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 + -