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

📄 index_0002ejsp_jsp.java

📁 电子商务系统 系统主要分为前台和后台。前台包括产品的展示及会员购物等模块
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
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_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_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\">\r\n\t\t\t");
      out.write("<marquee direction=\"left\" scrollamount=\"1\" scrolldelay=\"1\" onMouseOver=\"this.stop();\" onMouseOut=\"this.start();\">\r\n\t\t\t");
if(username==null || username==""){
      out.write("^_^ 顾客您好!购买商品请先登录 ");
      out.write("<a href=\"register.jsp\" class=\"word_green\">[新用户注册]");
      out.write("</a>");
}else{
      out.write("^_^ ");
      out.print(username);
      out.write(" 您好! Go购电子商城欢迎您!");
}
      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\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 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?ID=");
      out.print(sale_ID);
      out.write("\">");
      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("<input name=\"see\" type=\"button\" class=\"btn_grey\" onClick=\"window.location.href='goods_detail.jsp?ID=");
      out.print(sale_ID);
      out.write("'\" value=\"详细信息\">\r\n\t\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(sale_ID);
      out.write("'\" value=\"购买\">\r\n\t\t\t\t\t\t ");
}
      out.write("\r\n\t\t\t\t\t   ");
      out.write("</td>\r\n                    ");
      out.write("</tr>\r\n                  ");

⌨️ 快捷键说明

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