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

📄 listmain_jsp.java

📁 java的一个完整的在线商店。很不错的,支持网上支付等功能。
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import cn.com.shoppingonline.*;
import java.util.*;

public final class listMain_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=UTF-8");
      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("\t\r\n");

	List productList = (List)session.getAttribute(Constants.SEARCH_PRODUCT_LIST_KEY);
	Product product = null;
	Integer tpage=(Integer)session.getAttribute(Constants.CUR_PAGEID_KEY);
	int pageId=tpage.intValue();
	Integer tpageCount=(Integer)session.getAttribute(Constants.PAGE_COUNT_KEY);
	int pageCount=tpageCount.intValue();
	Integer tSortId=(Integer)session.getAttribute(Constants.CUR_SORTID_KEY);
	int sortId=tSortId.intValue();
	String keyword=(String)session.getAttribute(Constants.CUR_KEYWORD_KEY);

      out.write("\r\n");
      out.write("\r\n");
      out.write("<HTML><HEAD><TITLE>Shopping Online</TITLE>\r\n");
      out.write("<META http-equiv=Content-Type content=\"text/html; charset=gb2312\"><LINK \r\n");
      out.write("href=\"images/css.css\" type=text/css rel=stylesheet></HEAD>\r\n");
      out.write("<BODY leftMargin=0 topMargin=0 >\r\n");
      out.write("<!-------------------------right-------------------------------><!-------------------------right begin------------------------------------->\r\n");
      out.write("      <TABLE style=\"MARGIN-BOTTOM: 6px\" cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("      align=center border=0>\r\n");
      out.write("        <TBODY>\r\n");
      out.write("        <TR bgColor=#ffffff>\r\n");
      out.write("          <TD vAlign=top align=middle colSpan=2 height=100>\r\n");
      out.write("            <TABLE style=\"MARGIN-BOTTOM: 6px\" cellSpacing=0 cellPadding=0 \r\n");
      out.write("            width=\"100%\" align=center border=0>\r\n");
      out.write("              <TBODY>\r\n");
      out.write("              <TR>\r\n");
      out.write("                <TD bgColor=#ffffff colSpan=2 height=100>\r\n");
      out.write("                  <DIV align=center></DIV>\r\n");
      out.write("                  <TABLE height=5 cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("                  bgColor=#ffffff border=0>\r\n");
      out.write("                    <TBODY>\r\n");
      out.write("                    <TR>\r\n");
      out.write("                      <TD>\r\n");
      out.write("                        <P align=center> </P></TD></TR>\r\n");
      out.write("                    <TR>\r\n");
      out.write("                      <TD style=\"BORDER-BOTTOM: #cccccc 1px solid\" width=478 \r\n");
      out.write("                      bgColor=#f7f7f7 height=2>\r\n");
      out.write("                        <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("border=0>\r\n");
      out.write("                          <TBODY>\r\n");
      out.write("                          <TR>\r\n");
      out.write("                            <TD width=\"8%\"> </TD>\r\n");
      out.write("                            <TD vAlign=center height=25>搜索结果  &gt;&gt;      \r\n");
      out.write("                            </TD></TR></TBODY></TABLE></TD></TR>\r\n");
      out.write("                    <TR>\r\n");
      out.write("                      <TD width=\"100%\">\r\n");
      out.write("                        <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("border=0>\r\n");
      out.write("                          <TBODY>\r\n");
      out.write("\r\n");
      out.write("              \r\n");
      out.write("\r\n");
      out.write("\t   ");
if(productList != null ){

       for(int i = 0;i < productList.size();i++)
       {  
       		product = (Product)productList.get(i);
      
      out.write("\r\n");
      out.write("\r\n");
      out.write("                           <TR>\r\n");
      out.write("                            <TD vAlign=top>\r\n");
      out.write("                              <DIV align=center></DIV>\r\n");
      out.write("                              <TABLE cellSpacing=0 cellPadding=0 width=\"99%\" \r\n");
      out.write("                              align=center border=0>\r\n");
      out.write("                                <TBODY>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD vAlign=top>\r\n");
      out.write("                                <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("                                border=0><!----------------------one showing unit------------------------------->\r\n");
      out.write("                                <TBODY>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD vAlign=top>\r\n");
      out.write("                                <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("                                align=center border=0>\r\n");
      out.write("                                <TBODY>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD align=left width=\"25%\" bgColor=#ffffff \r\n");
      out.write("                                rowSpan=5><A \r\n");
      out.write("                                href=\"detail.do?productId=");
      out.print(product.getId());
      out.write("\"><IMG \r\n");
      out.write("                                src=\"");
      out.print(product.getImage());
      out.write("\"  \r\n");
      out.write("                                border=0></A> \r\n");
      out.write("                                <DIV align=right></DIV>\r\n");
      out.write("                                <DIV align=right></DIV>\r\n");
      out.write("                                <DIV align=right></DIV></TD>\r\n");
      out.write("                                <TD width=\"75%\" bgColor=#ffffff \r\n");
      out.write("                                height=25> </TD></TR>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD width=\"75%\" bgColor=#ffffff height=28><A \r\n");
      out.write("                                href=\"detail.do?productId=");
      out.print(product.getId());
      out.write("\"><FONT \r\n");
      out.write("                                color=#006699><U>");
      out.print(product.getName());
      out.write("</U></FONT></A></TD></TR>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD style=\"LINE-HEIGHT: 20px\" width=\"75%\" \r\n");
      out.write("                                bgColor=#ffffff \r\n");
      out.write("                                height=28>");
      out.print(product.getDescript());
      out.write("</TD></TR>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD width=\"75%\" bgColor=#ffffff \r\n");
      out.write("                                height=28>市场价格:<S>");
      out.print(product.getPrice());
      out.write("</S>元 本站会员价:");
      out.print(product.getSaleprice());
      out.write("元<BR><A \r\n");
      out.write("                                href=\"buy.do?productId=");
      out.print(product.getId());
      out.write("\">定购<IMG height=15 \r\n");
      out.write("                                src=\"images/order.gif\" width=21 \r\n");
      out.write("                                align=middle border=0></A></TD></TR>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD width=\"75%\" bgColor=#ffffff \r\n");
      out.write("                                height=25>    </TD></TR></TBODY></TABLE>\r\n");
      out.write("                                <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" \r\n");
      out.write("                                border=0>\r\n");
      out.write("                                <TBODY>\r\n");
      out.write("                                <TR>\r\n");
      out.write("                                <TD \r\n");
      out.write("height=1></TD></TR></TBODY></TABLE></TD></TR>\r\n");
      out.write("              \r\n");
      out.write("      ");
	
         }
      }	
      out.write("\r\n");
      out.write("              \r\n");
      out.write("<!-----------------------show unit end-----------------------------------------------></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>\r\n");
      out.write("                    \r\n");
      out.write("                    <TR>\r\n");
      out.write("                      <TD  height=23>\r\n");
      out.write("                        第");
      out.print(pageId+1);
      out.write('页');
      out.write('/');
      out.write('共');
      out.print(pageCount);
      out.write("页&nbsp;&nbsp;&nbsp;     \r\n");
      out.write("                      </TD>\r\n");
      out.write("                      <TD  height=23>  \r\n");
      out.write("                        <form action=\"search.do\" method=\"post\">\r\n");
      out.write("                        <input type=\"hidden\" value=\"");
      out.print(sortId);
      out.write("\" name=\"sortId\">\r\n");
      out.write("\t\t                 <input type=\"hidden\" value=\"");
      out.print((keyword));
      out.write("\" name=\"keyword\">\r\n");
      out.write("\t\t                 <input type=\"hidden\" value=\"");
      out.print(pageId-1);
      out.write("\" name=\"pageId\">\r\n");
      out.write("\t\t                 <input type=\"submit\" value=\"上一页\">\r\n");
      out.write("\t\t                 </form>\r\n");
      out.write("\t\t                </TD>\r\n");
      out.write("\t\t                <TD  height=23>\r\n");
      out.write("                         <form action=\"search.do\" method=\"post\">\r\n");
      out.write("                        <input type=\"hidden\" value=\"");
      out.print(sortId);
      out.write("\" name=\"sortId\">\r\n");
      out.write("\t\t                 <input type=\"hidden\" value=\"");
      out.print((keyword));
      out.write("\" name=\"keyword\">\r\n");
      out.write("\t\t                 <input type=\"hidden\" value=\"");
      out.print(pageId+1);
      out.write("\" name=\"pageId\">\r\n");
      out.write("\t\t                 <input type=\"submit\" value=\"下一页\">\r\n");
      out.write("\t\t                 </form> \r\n");
      out.write("                        </TD>\r\n");
      out.write("                        \r\n");
      out.write("                        </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!-------------------------right end-------------------------------------><!--------------------------left end--------------------------------------------->\r\n");
      out.write("<table></BODY>");
    } 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 + -