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

📄 showware_jsp.java

📁 jsp mysql 实现网上购物系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.mybusiness.web.ware.ware;
import com.mybusiness.util.str;

public final class showware_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  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;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      com.mybusiness.web.waremn book = null;
      synchronized (_jspx_page_context) {
        book = (com.mybusiness.web.waremn) _jspx_page_context.getAttribute("book", PageContext.PAGE_SCOPE);
        if (book == null){
          book = new com.mybusiness.web.waremn();
          _jspx_page_context.setAttribute("book", book, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');

String mesg = "";
int Id=0;
if (request.getParameter("bookid")==null || request.getParameter("bookid").equals("")) {
		mesg = "你要查看的商品不存在!";
} else {
	try {
		Id = Integer.parseInt(request.getParameter("bookid"));
		if (!book.getOnebook(Id)){
			mesg = "你要查看的商品不存在!";
		}
	} catch (Exception e){
		mesg = "你要查看的商品不存在!";
	}
}


      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>商场翱游购物系统 查看商品资料</title>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<script language=\"javascript\">\r\n");
      out.write("function check()\r\n");
      out.write("{\r\n");
      out.write("\tif (document.form1.amount.value<1){\r\n");
      out.write("\t\talert(\"你的购买数量有问题\");\r\n");
      out.write("\t\tdocument.form1.amount.focus();\r\n");
      out.write("\t\treturn false;\r\n");
      out.write("\t}\r\n");
      out.write("\treturn true;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("<link rel=\"stylesheet\" href=\"ware.css\" type=\"text/css\">\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body  background=images/112.gif text=\"#000000\">\r\n");
      out.write("<div align=\"center\">\r\n");
      out.write("  <p>商场翱游购物系统欢迎你<font color=\"#CC0066\">选购商品</font>!</p>\r\n");
      out.write("  ");
 if(!mesg.equals("")){
		out.println(mesg);
	  } else {
		ware bk = (ware) book.getBooklist().elementAt(0);			  
	
      out.write("\r\n");
      out.write("  <table width=\"90%\" border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\r\n");
      out.write("    <form name=\"form1\" method=\"post\" action=\"purchase.jsp\">\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\">商品名:</td>\r\n");
      out.write("        <td>");
      out.print( bk.getBookName() );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\">所属类别:</td>\r\n");
      out.write("        <td>");
      out.print( bk.getClassname() );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\">生产商:</td>\r\n");
      out.write("        <td>");
      out.print( bk.getPublish() );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\">商品编号:</td>\r\n");
      out.write("        <td>");
      out.print( bk.getBookNo() );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\">书价:</td>\r\n");
      out.write("        <td>");
      out.print( bk.getPrince() );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\" valign=\"top\">内容介绍:</td>\r\n");
      out.write("        <td>");
      out.print( str.toHtml(bk.getContent()) );
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\" valign=\"top\">&nbsp;</td>\r\n");
      out.write("        <td>&nbsp;</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\" valign=\"top\">购买:</td>\r\n");
      out.write("        <td> \r\n");
      out.write("          <input type=\"text\" name=\"amount\" maxlength=\"5\" size=\"3\" value=\"1\">\r\n");
      out.write("          </td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr> \r\n");
      out.write("        <td align=\"right\" width=\"120\" valign=\"top\">&nbsp;</td>\r\n");
      out.write("        <td> \r\n");
      out.write("\t\t  <input type=\"hidden\" name=\"bookid\" value=\"");
      out.print(Id );
      out.write("\" >\r\n");
      out.write("          <input type=\"submit\" name=\"Submit\" value=\"购买\" onclick=\"return(check());\">\r\n");
      out.write("          <input type=\"reset\" name=\"reset\" value=\"取消\">\r\n");
      out.write("        </td>\r\n");
      out.write("      </tr>\r\n");
      out.write("    </form>\r\n");
      out.write("  </table>\r\n");
 } 
      out.write("\r\n");
      out.write("  <br><p><a href=\"javascript:window.close()\">关闭窗口</a></p>\r\n");
      out.write("  <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td align=\"center\">开发:王文耀<br>\r\n");
      out.write("        CopyRight@2006<br>\r\n");
      out.write("        Email:<a href=\"mailto:wwy170@163.com\">wwy170@163.com</a></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("  \r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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