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

📄 sale_0002ejsp_jsp.java

📁 电子商务系统 系统主要分为前台和后台。前台包括产品的展示及会员购物等模块
💻 JAVA
字号:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import java.sql.*;
import com.wgh.DB.connDB;

public class sale_0002ejsp_jsp extends HttpJspBase {


  private static java.util.Vector _jspx_includes;

  public java.util.List getIncludes() {
    return _jspx_includes;
  }

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

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _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();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");

connDB conn=new connDB();
String username=(String)session.getAttribute("username");
ResultSet rs=conn.executeQuery("select ID,GoodsName,Introduce,price,nowprice,picture from tb_goods where sale=1 order by GoodsName");
int goodsID=-1;
String goodsName="";
String introduce="";
float price=(float)0.0;
float nowprice=(float)0.0;
String picture="";

      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>Go购电子商城");
      out.write("</title>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<link href=\"CSS/style.css\" rel=\"stylesheet\">\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("<table width=\"790\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n ");
      out.write("<tr>\r\n ");
      out.write("<td class=\"tableBorder\">\r\n");
      JspRuntimeLibrary.include(request, response, "navigation.jsp", out, false);
      out.write("\r\n");
      out.write("<table width=\"790\" height=\"236\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n  ");
      out.write("<tr>\r\n    ");
      out.write("<td width=\"182\" height=\"182\" valign=\"top\">\r\n\t");
      JspRuntimeLibrary.include(request, response, "left.jsp", out, false);
      out.write("\r\n\t");
      out.write("</td>\r\n    ");
      out.write("<td valign=\"top\">");
      out.write("<table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td height=\"33\" background=\"images/shop_12.gif\">");
      out.write("</td>\r\n        ");
      out.write("<td width=\"505\" height=\"33\" align=\"right\" valign=\"middle\" background=\"images/shop_12.gif\">");
      out.write("<table width=\"100%\" height=\"24\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n          ");
      out.write("<tr>\r\n            ");
      out.write("<td height=\"8\">");
      out.write("</td>\r\n          ");
      out.write("</tr>\r\n          ");
      out.write("<tr>\r\n            ");
      out.write("<td align=\"right\" class=\"word_green\">");
      out.write("<marquee direction=\"left\" scrollamount=\"1\" scrolldelay=\"1\" onMouseOver=\"this.stop();\" onMouseOut=\"this.start();\">^_^ 顾客您好!购买商品请先登录 ");
      out.write("<a href=\"register.jsp\" class=\"word_green\">[新用户注册]");
      out.write("</a>");
      out.write("</marquee>");
      out.write("</td>\r\n          ");
      out.write("</tr>\r\n        ");
      out.write("</table>");
      out.write("</td>\r\n        ");
      out.write("<td width=\"10\" background=\"images/shop_12.gif\">&nbsp;");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td width=\"93\" height=\"50\" background=\"images/shop_15.gif\">&nbsp;");
      out.write("</td>\r\n        ");
      out.write("<td colspan=\"2\" background=\"images/shop_16.gif\">\r\n\t\t  ");
      JspRuntimeLibrary.include(request, response, "search.jsp", out, false);
      out.write("\r\n\t\t");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n    ");
      out.write("</table>\r\n      ");
      out.write("<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n        ");
      out.write("<tr>\r\n          ");
      out.write("<td height=\"189\" valign=\"top\">");
      out.write("<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n            ");
      out.write("<tr>\r\n              ");
      out.write("<td height=\"80\" background=\"images/center_sale.gif\">&nbsp;");
      out.write("</td>\r\n              ");
      out.write("</tr>\r\n            ");
      out.write("<tr valign=\"top\">\r\n              ");
      out.write("<td height=\"134\" align=\"center\">\r\n\t\t\t  ");

	while(rs.next()){
	goodsID=rs.getInt(1);
	goodsName=rs.getString(2);
	introduce=rs.getString(3);
	price=rs.getFloat(4);
	nowprice=rs.getFloat(5);
	picture=rs.getString(6); 
	
      out.write("\r\n                  ");
      out.write("<table width=\"98%\" height=\"79\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"noborder\">\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td width=\"37%\" height=\"95\" rowspan=\"5\" align=\"center\">");
      out.write("<img src=\"images/goods/");
      out.print(picture);
      out.write("\" width=\"184\" height=\"119\">");
      out.write("</td>\r\n                      ");
      out.write("<td width=\"63%\" height=\"27\">");
      out.print(goodsName);
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"27\" style=\"text-decoration:line-through;color:#FF0000\">原价:");
      out.print(price);
      out.write(" (元)");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"27\">现价:");
      out.print(nowprice);
      out.write("(元) ");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"27\">");
      out.print(introduce);
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td>");
      out.write("<input name=\"Submit\" type=\"submit\" class=\"btn_grey\" onClick=\"history.back(-1);\" value=\"返回\">\r\n&nbsp;\t\t\t\t\t  ");
if (username!=null && username!=""){
      out.write("&nbsp;\r\n\t\t\t\t\t\t ");
      out.write("<input name=\"see\" type=\"button\" class=\"btn_grey\" onClick=\"window.location.href='cart_add.jsp?goodsID=");
      out.print(goodsID);
      out.write("'\" value=\"购买\">\r\n\t\t\t\t\t\t ");
}
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                  ");
      out.write("</table>\r\n\t\t\t\t  ");
      out.write("<hr align=\"center\" width=\"92%\" size=\"1\">\r\n\t\t\t\t  ");
}
      out.write("\r\n                 ");
      out.write("</td>\r\n            ");
      out.write("</tr>\r\n            ");
      out.write("<tr>\r\n              ");
      out.write("<td height=\"38\" align=\"right\" background=\"images/center02.gif\">");
      out.write("<a href=\"sale.jsp\">");
      out.write("<br>\r\n                    ");
      out.write("<br>\r\n              ");
      out.write("</a>");
      out.write("</td>\r\n              ");
      out.write("</tr>\r\n          ");
      out.write("</table>");
      out.write("</td>\r\n          ");
      out.write("</tr>\r\n      ");
      out.write("</table>");
      out.write("</td>\r\n  ");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"790\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n  ");
      out.write("<tr>\r\n    ");
      out.write("<td>");
      out.write("<table width=\"100%\" height=\"78\"  border=\"0\" align=\"center\" cellpadding=\"-2\" cellspacing=\"-2\">\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td height=\"13\" colspan=\"5\">");
      out.write("<div align=\"center\">\r\n          ");
      out.write("<hr width=\"100%\" size=\"1\">\r\n          ");
      out.write("</div>");
      out.write("</td>\r\n        ");
      out.write("</tr>\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td width=\"124\" height=\"13\">&nbsp;");
      out.write("</td>\r\n        ");
      out.write("<td height=\"13\" colspan=\"3\" align=\"center\">Go购电子商城客户服务热线:0431-4978981,4978982 传真:0431-4972266");
      out.write("</td>\r\n        ");
      out.write("<td width=\"141\">&nbsp;");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td height=\"15\" colspan=\"2\">&nbsp;");
      out.write("</td>\r\n        ");
      out.write("<td width=\"464\" valign=\"bottom\" align=\"center\"> CopyRight &copy; 2005 www.mingrisoft.com 吉林省明日科技有限公司");
      out.write("</td>\r\n        ");
      out.write("<td colspan=\"2\">&nbsp;");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n      ");
      out.write("<tr>\r\n        ");
      out.write("<td colspan=\"2\">&nbsp;");
      out.write("</td>\r\n        ");
      out.write("<td align=\"center\">本站请使用IE6.0或以上版本 1024*768为最佳显示效果");
      out.write("</td>\r\n        ");
      out.write("<td colspan=\"2\">&nbsp;");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n      ");
      out.write("<tr bgcolor=\"#cccccc\">\r\n        ");
      out.write("<td height=\"8\" colspan=\"2\">");
      out.write("</td>\r\n        ");
      out.write("<td height=\"8\" align=\"center\">");
      out.write("</td>\r\n        ");
      out.write("<td height=\"8\" colspan=\"2\">");
      out.write("</td>\r\n      ");
      out.write("</tr>\r\n    ");
      out.write("</table>");
      out.write("</td>\r\n  ");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("</td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
conn.close();
      out.write("\r\n");
    } catch (Throwable t) {
      out = _jspx_out;
      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 + -