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

📄 bookstore_jsp.java

📁 实现在线书店的基本功能 应用了hibernate+jsp 技术采用了mvc三层设计模式
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.*;
import mypack.*;
import java.util.Properties;
import mypack.*;

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


   public String convert(String s){
    return s;
   }

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  static {
    _jspx_dependants = new java.util.ArrayList(2);
    _jspx_dependants.add("/common.jsp");
    _jspx_dependants.add("/banner.jsp");
  }

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    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 {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"errorpage.jsp", 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("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      mypack.BookDB bookDB = null;
      synchronized (application) {
        bookDB = (mypack.BookDB) _jspx_page_context.getAttribute("bookDB", PageContext.APPLICATION_SCOPE);
        if (bookDB == null){
          bookDB = new mypack.BookDB();
          _jspx_page_context.setAttribute("bookDB", bookDB, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");
      out.write('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      mypack.ShoppingCart cart = null;
      synchronized (session) {
        cart = (mypack.ShoppingCart) _jspx_page_context.getAttribute("cart", PageContext.SESSION_SCOPE);
        if (cart == null){
          cart = new mypack.ShoppingCart();
          _jspx_page_context.setAttribute("cart", cart, PageContext.SESSION_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
      out.write("<head>\r\n");
      out.write("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n");
      out.write("    <title>bookstore</title>\r\n");
      out.write("    <style type=\"text/css\">\r\n");
      out.write("        <!--\r\n");
      out.write("        @import url(\"common.css\");\r\n");
      out.write("        -->\r\n");
      out.write("    </style>\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body >\r\n");
      out.write("<center>\r\n");
      out.write("    <img src=\"logo.bmp\" >\r\n");
      out.write("</center>\r\n");
      out.write("\r\n");
      out.write("<right>\r\n");
      out.write("    <a href=\"bookstore.jsp\">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;\r\n");
      out.write("    <a href=\"login.jsp\">登录</a>&nbsp;&nbsp;&nbsp;<a href=\"regist.jsp\">新用户注册</a>\r\n");
      out.write("    <left><a href=\"exit.jsp\">登出</a></left>\r\n");
      out.write("    \r\n");
      out.write("</right>\r\n");
      out.write("\r\n");
      out.write("<hr>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<table width=\"1023\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("    <!--DWLayoutTable-->\r\n");
      out.write("    <tr>\r\n");
      out.write("        <td width=\"278\" height=\"48\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("                <!--DWLayoutTable-->\r\n");
      out.write("                <tr>\r\n");
      out.write("                    <td>\r\n");
      out.write("                        ");

            if (session.getAttribute("user") != null) {
                Customer user = (Customer) session.getAttribute("user");
                String username = user.getUserName();
                        
      out.write("\r\n");
      out.write("                        <strong><a> 欢迎,");
      out.print(username);
      out.write("!&nbsp;</a></strong>\r\n");
      out.write("                      \r\n");
      out.write("                        ");

            }
                        
      out.write("\r\n");
      out.write("                    &nbsp;</td>\r\n");
      out.write("                </tr>\r\n");
      out.write("        </table>    </td>\r\n");
      out.write("        <td width=\"745\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("                <!--DWLayoutTable-->\r\n");
      out.write("                <tr>\r\n");
      out.write("                    <td width=\"500\" height=\"64\" align=\"center\" valign=\"top\">\r\n");
      out.write("                        <h3><a href=\"booksSort.jsp\"><font color=\"green\">书籍排行榜</font></a></h3>\r\n");
      out.write("                    </td>\r\n");
      out.write("                    <td width=\"745\" height=\"64\" align=\"center\" valign=\"top\">\r\n");
      out.write("             \r\n");
      out.write("  <form  action=bookdetails.jsp method=\"POST\">\r\n");
      out.write(" \r\n");
      out.write("     <select name=\"select\" id=\"select\">\r\n");
      out.write("       \r\n");
      out.write("      <option value=\"1\">编号</option>\r\n");
      out.write("      <option value=\"2\">书名</option>\r\n");
      out.write("      <option value=\"3\">作者</option>\r\n");
      out.write("      </select>\r\n");
      out.write("    <input type=\"text\" size=\"20\" name=\"message\" value=\"\" >\r\n");
      out.write("    <input type=submit  value=\"搜\">\r\n");
      out.write("    </form>\r\n");
      out.write("  </td>\r\n");
      out.write("\r\n");
      out.write("                </tr>\r\n");
      out.write("            </table>\r\n");
      out.write("        </td>\r\n");
      out.write("        \r\n");
      out.write("    </tr>\r\n");
      out.write("    \r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<table width=\"1023\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("<!--DWLayoutTable-->\r\n");
      out.write("<tr>\r\n");
      out.write("<td width=\"229\" height=\"292\" valign=\"top\">\r\n");
      out.write("    <table width=\"1023\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("    <!--DWLayoutTable-->\r\n");
      out.write("    <tr>\r\n");
      out.write("        <td width=\"229\" height=\"256\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("                <!--DWLayoutTable-->\r\n");

⌨️ 快捷键说明

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