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

📄 default_jsp.java

📁 JSP网上书店系统 采用ACCESS数据库
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    boolean bIsScroll = true;
    boolean hasParam = false;
    String sOrder = "";
    String sSQL="";
    String transitParams = "";
    String sQueryString = "";
    String sPage = "";
    int RecordsPerPage = 20;
    String sSortParams = "";
    String formParams = "";


 
    // Build WHERE statement
        
    sWhere = " AND editorial_cat_id=3";

  // Build full SQL statement
  
  sSQL = "select e.article_desc as e_article_desc, " +
    "e.article_title as e_article_title, " +
    "e.item_id as e_item_id, " +
    "i.item_id as i_item_id, " +
    "i.image_url as i_image_url " +
    " from editorials e, items i" +
    " where i.item_id=e.item_id  ";
  
  sSQL = sSQL + sWhere + sOrder;

  String sNoRecords = "     <tr>\n      <td colspan=\"1\" style=\"background-color: #FFFFFF; border-width: 1\"><font style=\"font-size: 10pt; color: #000000\">No records</font></td>\n     </tr>";


  String tableHeader = "";
    
  
  try {
    out.println("    <table style=\"\">");
    out.println("     <tr>\n      <td style=\"background-color: #336699; text-align: Center; border-style: outset; border-width: 1\" colspan=\"1\"><a name=\"Weekly\"><font style=\"font-size: 12pt; color: #FFFFFF; font-weight: bold\">This Week's Featured Books</font></a></td>\n     </tr>");
    out.println(tableHeader);

  }
  catch (Exception e) {}

  
  try {
    java.sql.ResultSet rs = null;
    // Open recordset
    rs = openrs( stat, sSQL);
    iCounter = 0;
    
    java.util.Hashtable rsHash = new java.util.Hashtable();
    String[] aFields = getFieldsName( rs );

    // Show main table based on recordset
    while ( rs.next() ) {

      getRecordToHash( rs, rsHash, aFields );
      String fldarticle_desc = (String) rsHash.get("e_article_desc");
      String fldarticle_title = (String) rsHash.get("e_article_title");
      String flditem_id = (String) rsHash.get("i_image_url");
flditem_id="<img border=0 src=" + flditem_id + ">";

      out.print("     <tr>\n      <td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"></font> </td></tr><tr><td style=\"background-color: #FFFFFF; border-width: 1\">"); out.print("<a href=\"BookDetail.jsp?"+transitParams+"item_id="+toURL((String) rsHash.get("e_item_id"))+"&\"><font style=\"font-size: 10pt; color: #000000\">"+toHTML(fldarticle_title)+"</font></a>");

      out.println("</td>\n     </tr>");
      out.print("     <tr>\n      <td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"></font> </td></tr><tr><td style=\"background-color: #FFFFFF; border-width: 1\">"); out.print("<a href=\"BookDetail.jsp?"+transitParams+"item_id="+toURL((String) rsHash.get("e_item_id"))+"&\"><font style=\"font-size: 10pt; color: #000000\">"+flditem_id+"</font></a>");

      out.println("</td>\n     </tr>");
      out.print("     <tr>\n      <td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"></font> </td></tr><tr><td style=\"background-color: #FFFFFF; border-width: 1\">"); out.print("<font style=\"font-size: 10pt; color: #000000\">"+toHTML(fldarticle_desc)+"&nbsp;</font>");
      out.println("</td>\n     </tr>");
      out.println("     <tr>\n      <td colspan=\"2\" style=\"background-color: #FFFFFF; border-width: 1\">&nbsp;</td>\n     </tr>");
    
      iCounter++;
    }
    if (iCounter == 0) {
      // Recordset is empty
      out.println(sNoRecords);
    
      iCounter = RecordsPerPage+1;
      bIsScroll = false;
    }

    if ( rs != null ) rs.close();
    out.println("    </table>");
    
  }
  catch (Exception e) { out.println(e.toString()); }
}


  void Specials_Show (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.jsp.JspWriter out, String sSpecialsErr, String sForm, String sAction, java.sql.Connection conn, java.sql.Statement stat) throws java.io.IOException  {
  
    String sWhere = "";
    int iCounter=0;
    int iPage = 0;
    boolean bIsScroll = true;
    boolean hasParam = false;
    String sOrder = "";
    String sSQL="";
    String transitParams = "";
    String sQueryString = "";
    String sPage = "";
    int RecordsPerPage = 20;
    String sSortParams = "";
    String formParams = "";


 
    // Build WHERE statement
        
    sWhere = " WHERE editorial_cat_id=4";

  // Build full SQL statement
  
  sSQL = "select e.article_desc as e_article_desc, " +
    "e.article_title as e_article_title " +
    " from editorials e ";
  
  sSQL = sSQL + sWhere + sOrder;

  String sNoRecords = "     <tr>\n      <td colspan=\"1\" style=\"background-color: #FFFFFF; border-width: 1\"><font style=\"font-size: 10pt; color: #000000\">No records</font></td>\n     </tr>";


  String tableHeader = "";
    
  
  try {
    out.println("    <table style=\"\">");
    out.println("     <tr>\n      <td style=\"background-color: #336699; text-align: Center; border-style: outset; border-width: 1\" colspan=\"1\"><a name=\"Specials\"><font style=\"font-size: 12pt; color: #FFFFFF; font-weight: bold\">Weekly Specials</font></a></td>\n     </tr>");
    out.println(tableHeader);

  }
  catch (Exception e) {}

  
  try {
    java.sql.ResultSet rs = null;
    // Open recordset
    rs = openrs( stat, sSQL);
    iCounter = 0;
    
    java.util.Hashtable rsHash = new java.util.Hashtable();
    String[] aFields = getFieldsName( rs );

    // Show main table based on recordset
    while ( rs.next() ) {

      getRecordToHash( rs, rsHash, aFields );
      String fldarticle_desc = (String) rsHash.get("e_article_desc");
      String fldarticle_title = (String) rsHash.get("e_article_title");

      out.print("     <tr>\n      <td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"></font> </td></tr><tr><td style=\"background-color: #FFFFFF; border-width: 1\">"); out.print("<font style=\"font-size: 10pt; color: #000000\">"+fldarticle_title+"&nbsp;</font>");
      out.println("</td>\n     </tr>");
      out.print("     <tr>\n      <td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"></font> </td></tr><tr><td style=\"background-color: #FFFFFF; border-width: 1\">"); out.print("<font style=\"font-size: 10pt; color: #000000\">"+fldarticle_desc+"&nbsp;</font>");
      out.println("</td>\n     </tr>");
      out.println("     <tr>\n      <td colspan=\"2\" style=\"background-color: #FFFFFF; border-width: 1\">&nbsp;</td>\n     </tr>");
    
      iCounter++;
    }
    if (iCounter == 0) {
      // Recordset is empty
      out.println(sNoRecords);
    
      iCounter = RecordsPerPage+1;
      bIsScroll = false;
    }

    if ( rs != null ) rs.close();
    out.println("    </table>");
    
  }
  catch (Exception e) { out.println(e.toString()); }
}

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(1);
    _jspx_dependants.add("/Common.jsp");
  }

  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");
      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;



boolean bDebug = false;

String sAction = getParam( request, "FormAction");
String sForm = getParam( request, "FormName");
String sSearchErr = "";
String sAdvMenuErr = "";
String sRecommendedErr = "";
String sWhatErr = "";
String sCategoriesErr = "";
String sNewErr = "";
String sWeeklyErr = "";
String sSpecialsErr = "";

java.sql.Connection conn = null;
java.sql.Statement stat = null;
String sErr = loadDriver();
conn = cn();
stat = conn.createStatement();
if ( ! sErr.equals("") ) {
 try {
   out.println(sErr);
 }
 catch (Exception e) {}
}


      out.write("            \r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>Book Store</title>\r\n");
      out.write("<meta name=\"GENERATOR\" content=\"YesSoftware CodeCharge v.1.2.0 / JSP.ccp build 05/21/2001\"/>\r\n");
      out.write("<meta http-equiv=\"pragma\" content=\"no-cache\"/>\r\n");
      out.write("<meta http-equiv=\"expires\" content=\"0\"/>\r\n");
      out.write("<meta http-equiv=\"cache-control\" content=\"no-cache\"/>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n");
      out.write("</head>\r\n");
      out.write("<body style=\"background-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helveticabackground-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\">\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "Header.jsp", out, true);
      out.write("\r\n");
      out.write(" <table>\r\n");
      out.write("  <tr>\r\n");
      out.write("   <td valign=\"top\">\r\n");
 Search_Show(request, response, session, out, sSearchErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
 AdvMenu_Show(request, response, session, out, sAdvMenuErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
 Categories_Show(request, response, session, out, sCategoriesErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
 Specials_Show(request, response, session, out, sSpecialsErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    </td>\r\n");
      out.write("   <td valign=\"top\"><table width=\"250\"><tr><td></td></tr></table>\r\n");
 Recommended_Show(request, response, session, out, sRecommendedErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    </td>\r\n");
      out.write("   <td valign=\"top\">\r\n");
 What_Show(request, response, session, out, sWhatErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
 New_Show(request, response, session, out, sNewErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
 Weekly_Show(request, response, session, out, sWeeklyErr, sForm, sAction, conn, stat); 
      out.write("\r\n");
      out.write("    \r\n");
      out.write("   </td>\r\n");
      out.write("  </tr>\r\n");
      out.write(" </table>\r\n");
      out.write("\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "Footer.jsp", out, true);
      out.write("\r\n");
      out.write("<center><font face=\"Arial\"><small>This dynamic site was generated with <a href=\"http://www.codecharge.com\">CodeCharge</a></small></font></center>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");

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

if ( stat != null ) stat.close();
if ( conn != null ) conn.close();

      out.write('\r');
      out.write('\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 + -