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

📄 inquire_0002ejsp_jsp.java

📁 网上书店,JSP,MYSQL,struct,spring,hibernate
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
import bookshoppingsys.*;
import java.util.Properties;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class Inquire_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/common.jsp";from=(3,0);to=(3,77)]
    // end
    // begin [file="/common.jsp";from=(4,3);to=(10,0)]
        
           public String convert(String s){
            try{
             	return new String(s.getBytes("ISO-8859-1"),"GB2312");
            }catch(Exception e){return null;}
           }
    // end

    static {
    }
    public Inquire_0002ejsp_jsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    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;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html; charset=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"errorpage.jsp", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/Inquire.jsp";from=(0,48);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/common.jsp";from=(0,38);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/common.jsp";from=(1,37);to=(2,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/common.jsp";from=(2,41);to=(3,0)]
                out.write("\r\n");

            // end
            // begin [file="/common.jsp";from=(3,0);to=(3,77)]
                bookshoppingsys.BookDB bookDB = null;
                boolean _jspx_specialbookDB  = false;
                 synchronized (application) {
                    bookDB= (bookshoppingsys.BookDB)
                    pageContext.getAttribute("bookDB",PageContext.APPLICATION_SCOPE);
                    if ( bookDB == null ) {
                        _jspx_specialbookDB = true;
                        try {
                            bookDB = (bookshoppingsys.BookDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bookshoppingsys.BookDB");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"bookshoppingsys.BookDB", exc);
                        }
                        pageContext.setAttribute("bookDB", bookDB, PageContext.APPLICATION_SCOPE);
                    }
                 } 
                if(_jspx_specialbookDB == true) {
            // end
            // begin [file="/common.jsp";from=(3,0);to=(3,77)]
                }
            // end
            // HTML // begin [file="/common.jsp";from=(3,77);to=(4,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/common.jsp";from=(10,2);to=(12,0)]
                out.write("\r\n\r\n");

            // end
            // HTML // begin [file="/Inquire.jsp";from=(1,32);to=(2,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/Inquire.jsp";from=(2,32);to=(14,0)]
                out.write("\r\n<html>\r\n<body>\r\n<br><br>\r\n搜索如下:\r\n<br><br>\r\n<table border=1 cellspacing=\"0\" cellpadding=\"0\">\r\n<tr><td width=\"80\"><font size=\"5\" color=\"#ab12ab\">书名</font></td>\r\n<td width=\"80\"><font size=\"5\" color=\"#ab12ab\">作者</font></td>\r\n<td width=\"80\"><font size=\"5\" color=\"#ab12ab\">价格</font></td>\r\n<td>详细</td>\r\n<td></td></tr>\r\n");

            // end
            // begin [file="/Inquire.jsp";from=(14,2);to=(29,0)]
                
                String inquireType=null;
                  if(((String)request.getParameter("inquireType")).equals("0")) inquireType="书名";
                  else if(((String)request.getParameter("inquireType")).equals("1")) inquireType="作者";
                  else if(((String)request.getParameter("inquireType")).equals("2")) inquireType="出版社";
                
                  if(inquireType.equals("书名")) {
                    String bookname =convert((String)request.getParameter("bookname"));
                    if(bookname==null){bookname="c++";}
                    	  Collection c = bookDB.getBooksBookname(bookname);
                          Iterator i = c.iterator();
                  	while (i.hasNext()) {
                        BookDetails book = (BookDetails)i.next();
                    	if(book==null)
                   	{
            // end
            // HTML // begin [file="/Inquire.jsp";from=(29,2);to=(30,47)]
                out.write("\r\n    <p>对不起,没有您要找的书<<<font size=\"3\" color=\"red\">");

            // end
            // begin [file="/Inquire.jsp";from=(30,50);to=(30,58)]
                out.print(bookname);
            // end
            // HTML // begin [file="/Inquire.jsp";from=(30,60);to=(31,14)]
                out.write("</font>>>!!<p>\r\n<form action=\"");

            // end
            // begin [file="/Inquire.jsp";from=(31,17);to=(31,41)]
                out.print(request.getContextPath());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(31,43);to=(32,0)]
                out.write("/catalog.jsp\" method=\"post\"><input type=\"image\" src=\"images\\\\goonbuy.gif\"></form>\r\n");

            // end
            // begin [file="/Inquire.jsp";from=(32,2);to=(35,0)]
                
                     return;
                   	}
            // end
            // HTML // begin [file="/Inquire.jsp";from=(35,2);to=(36,29)]
                out.write("\r\n<tr><td height=\"20\"><a href=\"");

            // end
            // begin [file="/Inquire.jsp";from=(36,32);to=(36,56)]
                out.print(request.getContextPath());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(36,58);to=(36,84)]
                out.write("/bookdetails.jsp?bookname=");

            // end
            // begin [file="/Inquire.jsp";from=(36,87);to=(36,114)]
                out.print((String)book.getBook_name());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(36,116);to=(36,133)]
                out.write("\" target=\"blank\">");

            // end
            // begin [file="/Inquire.jsp";from=(36,136);to=(36,163)]
                out.print((String)book.getBook_name());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(36,165);to=(36,178)]
                out.write("</a></td><td>");

            // end
            // begin [file="/Inquire.jsp";from=(36,181);to=(36,205)]
                out.print((String)book.getAuthor());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(36,207);to=(36,216)]
                out.write("</td><td>");

            // end
            // begin [file="/Inquire.jsp";from=(36,219);to=(36,236)]
                out.print(book.getT_value());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(36,238);to=(37,33)]
                out.write("</td>\r\n<td><form target=\"blank\" action=\"");

            // end
            // begin [file="/Inquire.jsp";from=(37,36);to=(37,60)]
                out.print(request.getContextPath());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(37,62);to=(37,88)]
                out.write("/bookdetails.jsp?bookname=");

            // end
            // begin [file="/Inquire.jsp";from=(37,91);to=(37,118)]
                out.print((String)book.getBook_name());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(37,120);to=(38,13)]
                out.write("\" method=\"post\"><input type=\"image\" src=\"images\\\\view.gif\" name=\"view\"></form></td>\r\n<td><a href=\"");

            // end
            // begin [file="/Inquire.jsp";from=(38,16);to=(38,40)]
                out.print(request.getContextPath());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(38,42);to=(38,59)]
                out.write("/catalog.jsp?Add=");

            // end
            // begin [file="/Inquire.jsp";from=(38,62);to=(38,89)]
                out.print((String)book.getBook_name());
            // end
            // HTML // begin [file="/Inquire.jsp";from=(38,91);to=(39,0)]
                out.write("\" target=\"blank\"><font color=\"#12bb00\">放入购物车</font></a><td></tr>\r\n");

            // end
            // begin [file="/Inquire.jsp";from=(39,2);to=(52,0)]
                //session.setAttribute("book_name",book.getbook_name()) ;
                
                	}
                  }
                  else if(inquireType.equals("作者")) {

⌨️ 快捷键说明

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