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

📄 search_0005fdeal_0002ejsp_jsp.java

📁 网上购物系统 用JSP做的 好几十页 用jbuilder运行
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class search_0005fdeal_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/search_deal.jsp";from=(2,0);to=(2,60)]
    // end
    // begin [file="/search_deal.jsp";from=(3,0);to=(3,58)]
    // end

    static {
    }
    public search_0005fdeal_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=gb2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

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

            // HTML // begin [file="/search_deal.jsp";from=(0,100);to=(2,0)]
                out.write("\r\n\r\n");

            // end
            // begin [file="/search_deal.jsp";from=(2,0);to=(2,60)]
                beans.connDB connDB = null;
                boolean _jspx_specialconnDB  = false;
                 synchronized (pageContext) {
                    connDB= (beans.connDB)
                    pageContext.getAttribute("connDB",PageContext.PAGE_SCOPE);
                    if ( connDB == null ) {
                        _jspx_specialconnDB = true;
                        try {
                            connDB = (beans.connDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.connDB");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"beans.connDB", exc);
                        }
                        pageContext.setAttribute("connDB", connDB, PageContext.PAGE_SCOPE);
                    }
                 } 
                if(_jspx_specialconnDB == true) {
            // end
            // begin [file="/search_deal.jsp";from=(2,0);to=(2,60)]
                }
            // end
            // HTML // begin [file="/search_deal.jsp";from=(2,60);to=(3,0)]
                out.write("\r\n");

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

            // end
            // begin [file="/search_deal.jsp";from=(4,2);to=(20,0)]
                
                String key="";
                String sql="";
                if(request.getParameter("bookkey")!=null){
                	key=chStr.chStr(request.getParameter("bookkey"));
                	sql="select * from tb_bookinfo where bookname like '%"+key+"%'";
                }else{
                	if(request.getParameter("key")==null){
                		key="空";
                		sql="select * from tb_bookinfo";
                	}else{
                		key=chStr.chStr(request.getParameter("key"));
                		sql="select * from tb_bookinfo where bookname like '%"+key+"%'";
                	}
                }
                ResultSet rs_search=connDB.executeQuery(sql);
            // end
            // HTML // begin [file="/search_deal.jsp";from=(20,2);to=(35,1)]
                out.write("\r\n<html>\r\n<head>\r\n<title>网上书店</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<link href=\"CSS/style.css\" rel=\"stylesheet\">\r\n</head>\r\n\r\n<body>\r\n<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"Images/bg.gif\">\r\n  <tr>\r\n    <td>\r\n<table width=\"777\" height=\"768\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">\r\n  <tr>\r\n    <td valign=\"top\">\r\n\t");

            // end
            // begin [file="/search_deal.jsp";from=(35,1);to=(35,30)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "Top.jsp" + _jspx_qStr, out, false);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/search_deal.jsp";from=(35,30);to=(39,3)]
                out.write("\r\n\t<table width=\"100%\" height=\"330\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td width=\"26%\" valign=\"top\">\r\n\t\t ");

            // end
            // begin [file="/search_deal.jsp";from=(39,3);to=(39,33)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "left.jsp" + _jspx_qStr, out, false);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/search_deal.jsp";from=(39,33);to=(45,2)]
                out.write("\r\n\t\t</td>\r\n          <td width=\"5\" valign=\"top\" background=\"Images/Cen_separate.gif\"></td>\r\n          <td width=\"73%\" valign=\"top\"><table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n            <tr>\r\n              <td height=\"53\" colspan=\"3\" background=\"Images/index_10.gif\">\r\n\t\t");

            // end
            // begin [file="/search_deal.jsp";from=(45,2);to=(45,34)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "search.jsp" + _jspx_qStr, out, false);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/search_deal.jsp";from=(45,34);to=(54,85)]
                out.write("\t</td>\r\n            </tr>\r\n            <tr>\r\n              <td width=\"97%\" height=\"220\" valign=\"top\">\r\n\t\t\t   <table width=\"100%\" height=\"126\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\r\n\t\t\t    <tr>\r\n                  <td valign=\"top\"><table width=\"100%\" height=\"55\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                    <tr>\r\n                      <td height=\"40\" class=\"tableBorder_B\"> &nbsp;&nbsp;您输入的查询关键字为:[");

            // end
            // begin [file="/search_deal.jsp";from=(54,88);to=(54,91)]
                out.print(key);
            // end
            // HTML // begin [file="/search_deal.jsp";from=(54,93);to=(66,0)]
                out.write("]</td>\r\n                    </tr>\r\n                    <tr>\r\n                      <td width=\"86%\" height=\"100\" valign=\"top\">\r\n\t\t\t\t\t\t<table width=\"96%\" height=\"34\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"tableBorder_B\">\r\n                          <tr>\r\n                            <td width=\"6%\" height=\"33\" align=\"center\">&nbsp;</td>\r\n                            <td width=\"48%\" style=\"padding:5px;\">书名</td>\r\n                            <td width=\"35%\" style=\"padding:5px;\">出版社</td>\r\n                            <td width=\"11%\" style=\"padding:5px;\">购买</td>\r\n                          </tr>\r\n                        </table>\r\n");

            // end
            // begin [file="/search_deal.jsp";from=(66,2);to=(95,3)]
                
                if(!(rs_search.next())){
                	out.println("<table width='96%' height='34'  border='0' align='center' cellpadding='0' cellspacing='0'");
                	out.println("<tr><td align='center'>无符合条件的数据!</td></tr></table>");
                }else{
                String str=(String)request.getParameter("Page");
                if(str==null){
                	str="0";
                }
                int pagesize=10;
                rs_search.last();

⌨️ 快捷键说明

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