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

📄 shopping_jsp.java

📁 Internet 开发技术分章节代码和自己完成的课程设计全代码(在zuoye文件夹里)使用时
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import bean.*;

public final class shopping_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  public Object 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=gb2312");
      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");
      bean.Products products = null;
      synchronized (session) {
        products = (bean.Products) _jspx_page_context.getAttribute("products", PageContext.SESSION_SCOPE);
        if (products == null){
          products = new bean.Products();
          _jspx_page_context.setAttribute("products", products, PageContext.SESSION_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("<html><head><title>shooping</title></head><body><center>\r\n");
      out.write("<form action=\"cart.jsp\" method=get>\r\n");
      out.write("<table width=\"75%\" border=\"1\" bordercolor=\"#006633\">\r\n");
      out.write("  <tr bgcolor=\"#999999\">\r\n");
      out.write("    <td>id</td>\r\n");
      out.write("    <td>名称</td>\r\n");
      out.write("    <td>价格</td>\r\n");
      out.write("    <td>是否有库存</td>\r\n");
      out.write("    <td>出版社</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  ");

  java.util.Vector v=products.getItems();
  java.util.Enumeration e=v.elements();
  while(e.hasMoreElements())
  {
  Item item=(Item)e.nextElement();
         
  
      out.write("\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td><input type=\"checkbox\" name=\"itemId\" value=\"");
      out.print(item.getItemId());
      out.write("\"></td>\r\n");
      out.write("    <td>");
      out.print(item.getDescription());
      out.write("</td>\r\n");
      out.write("    <td>");
      out.print(item.getPrice());
      out.write("</td>\r\n");
      out.write("    <td>");
      out.print(item.getAvailable());
      out.write("</td>\r\n");
      out.write("    <td>");
      out.print(item.getProducer());
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  ");
}
      out.write("\r\n");
      out.write(" <tr align=left><td colspan=5 ><input type=submit value=\"add\" name=\"action\"></td></tr> \r\n");
      out.write(" <tr align=left><td colspan=5><a href=\"cart.jsp\">购物车</a>『』<a href=\"logout.jsp\">注销</a></td></tr>\r\n");
      out.write("</table>\r\n");
      out.write("</form></center>\r\n");
      out.write("</body></html>\r\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 + -