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

📄 index_jsp.java

📁 电子商务系统主要分为前台和后台。前台包括产品的展示及会员购物等模块
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp;

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 index_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();
ResultSet rs_superType=conn.executeQuery("select ID,superType from V_Type group by ID,superType order by superType desc");
ResultSet rs_sale=conn.executeQuery("select top 2 ID,GoodsName,price,nowprice,picture from tb_goods where sale=1 order by INTime desc");
int sale_ID=0;
String s_goodsname="";
float s_price=0;
float s_nowprice=0;
String s_picture="";
ResultSet rs_new=conn.executeQuery("select top 4 ID,GoodsName,nowprice,introduce,picture from tb_goods where newGoods=1 order by INTime desc");
int new_ID=0;
String new_goodsname="";
float new_nowprice=0;
String new_introduce="";
String new_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       ");
      out.write("<form name=\"form2\" method=\"post\" action=\"search_deal.jsp\">\r\n\t\t\t\t\t");
      out.write("<table width=\"100%\" height=\"23\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                ");
      out.write("<tr>\r\n                  ");
      out.write("<td colspan=\"2\" height=\"7\">");
      out.write("</td>\r\n                  ");
      out.write("</tr>\r\n                ");
      out.write("<tr>\r\n                  ");
      out.write("<td width=\"85%\">请输入查询条件:\r\n                    ");
      out.write("<select name=\"select\" class=\"textarea\">\r\n                      ");
      out.write("<option value=\"all\" selected>全部分类");
      out.write("</option>\r\n                          ");
      out.write("</select>                  ");
      out.write("<input name=\"bookkey\" type=\"text\" class=\"txt_grey\" size=\"33\">                  ");
      out.write("</td>\r\n                  ");
      out.write("<td width=\"15%\">");
      out.write("<input name=\"search\" type=\"submit\" class=\"btn_grey\" value=\"搜索\">");
      out.write("</td>\r\n                ");
      out.write("</tr>\r\n              ");
      out.write("</table>\r\n\t\t\t   ");
      out.write("</form>\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 width=\"69%\" 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 width=\"98%\" height=\"80\" background=\"images/shop_18.gif\">&nbsp;");
      out.write("</td>\r\n              ");
      out.write("<td width=\"2%\">");
      out.write("<img src=\"images/shop_19.gif\" width=\"10\" height=\"80\">");
      out.write("</td>\r\n            ");
      out.write("</tr>\r\n            ");
      out.write("<tr align=\"center\" valign=\"top\">\r\n              ");
      out.write("<td height=\"134\" colspan=\"2\">");
      out.write("<table width=\"100%\" height=\"162\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                ");
      out.write("<tr>\r\n                  ");
      out.write("<td width=\"49%\" height=\"162\" valign=\"top\">\r\n\t\t\t\t  ");
int s=1;
				  while (rs_sale.next()){
					sale_ID=rs_sale.getInt(1);
					s_goodsname=rs_sale.getString(2);
					s_price=rs_sale.getFloat(3);
					s_nowprice=rs_sale.getFloat(4);
					s_picture=rs_sale.getString(5);
				  	if(s%2==1){
				  
      out.write("\r\n\t\t\t\t  ");
      out.write("<table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"95\" align=\"center\">");
      out.write("<img src=\"images/goods/");
      out.print(s_picture);
      out.write("\" width=\"150\" height=\"88\">");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"22\" align=\"center\">");
      out.write("<a href=\"goods_detail.jsp\">");
      out.print(s_goodsname);
      out.write("</a>");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"20\" align=\"center\" style=\"text-decoration:line-through;color:#FF0000\">原价:");
      out.print(s_price);
      out.write(" ");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"20\" align=\"center\">现价:");
      out.print(s_nowprice);
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td height=\"22\" align=\"center\"> ");
      out.write("<a href=\"goods_detail.jsp?ID=");
      out.print(sale_ID);
      out.write("\">查看详细信息");
      out.write("</a> ");
      out.write("<a href=\"cart_see.jsp\">购买");
      out.write("</a>");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                  ");
      out.write("</table>\r\n\t\t\t\t  ");
}else{
      out.write("\r\n\t\t\t\t  ");
      out.write("</td>\r\n                  ");
      out.write("<td width=\"2%\" align=\"center\" valign=\"top\">");
      out.write("<table width=\"3\" height=\"160\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"images/point.gif\">\r\n                    ");
      out.write("<tr>\r\n                      ");
      out.write("<td>");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                  ");
      out.write("</table>");
      out.write("</td>\r\n                  ");
      out.write("<td width=\"49%\" valign=\"top\">\r\n\t\t\t\t    ");
      out.write("<table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                      ");
      out.write("<tr>\r\n                        ");
      out.write("<td height=\"95\" align=\"center\">");
      out.write("<img src=\"images/goods/");
      out.print(s_picture);
      out.write("\" width=\"150\" height=\"88\">");
      out.write("</td>\r\n                      ");
      out.write("</tr>\r\n                      ");
      out.write("<tr>\r\n                        ");
      out.write("<td height=\"22\" align=\"center\">");
      out.write("<a href=\"goods_detail.jsp\">");
      out.print(s_goodsname);
      out.write("</a>");
      out.write("</td>\r\n                      ");
      out.write("</tr>\r\n                      ");
      out.write("<tr>\r\n                        ");
      out.write("<td height=\"20\" align=\"center\" style=\"text-decoration:line-through;color:#FF0000\">原价:");
      out.print(s_price);
      out.write(" ");
      out.write("</td>\r\n                      ");
      out.write("</tr>\r\n                      ");
      out.write("<tr>\r\n                        ");
      out.write("<td height=\"20\" align=\"center\">现价:");
      out.print(s_nowprice);
      out.write("</td>\r\n                      ");
      out.write("</tr>\r\n                      ");
      out.write("<tr>\r\n                        ");
      out.write("<td height=\"22\" align=\"center\"> ");
      out.write("<a href=\"goods_detail.jsp?ID=");
      out.print(sale_ID);
      out.write("\">查看详细信息");
      out.write("</a> ");
      out.write("<a href=\"cart_see.jsp\">购买");
      out.write("</a>");
      out.write("</td>\r\n                      ");
      out.write("</tr>\r\n                    ");
      out.write("</table>\r\n\t\t\t\t    ");
}
				  s++;
				  }
      out.write("\t\t\t\t  ");
      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("<tr>\r\n              ");
      out.write("<td height=\"42\" align=\"right\" background=\"images/shop_24.gif\">");
      out.write("<a href=\"sale.jsp\">");
      out.write("<img src=\"images/MORE.GIF\" width=\"50\" height=\"20\" border=\"0\">");
      out.write("</a>");
      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("<td height=\"42\" background=\"images/shop_25.gif\">&nbsp;");
      out.write("</td>\r\n            ");

⌨️ 快捷键说明

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