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

📄 resultshow.jsp

📁 本系统实现了从五个网站上搜索的图书进行整合后
💻 JSP
📖 第 1 页 / 共 3 页
字号:
                               if(!"null".equals(keywordList.get(1))){
                                    if(bookAuthor.toLowerCase().indexOf(keywordList.get(1)) != -1){
 
                                         int index = 0;
                                         index = bookAuthor.toLowerCase().indexOf(keywordList.get(1));
                                         bookAuthor = bookAuthor.replace(bookAuthor.substring(index,(index + keywordList.get(1).length())),
                                                      "<b>"
                                                      + bookAuthor.substring(index,(index + keywordList.get(1).length()))
                                                      + "</b>");                    
                                   }else if(keywordList.get(1).indexOf(" ") != -1){
                                        
                                        StringTokenizer temst = new StringTokenizer(keywordList.get(1), " ");
			                            ArrayList<String> keywordArr = new ArrayList<String>();
			                            while (temst.hasMoreElements()) {
			                               String temstr = temst.nextToken();
				                           if(null != temstr)
				                               keywordArr.add(temstr.trim());
			                            }

			                            String temStr = "";
			                            for (int j = 0; j < keywordArr.size(); j++) {
				                             if (bookAuthor.toLowerCase().indexOf(keywordArr.get(j)) != -1) {
				                             
				                             	if(temStr.toLowerCase().indexOf(keywordArr.get(j)) == -1){
					                                 int index = 0;
                                                     index = bookAuthor.toLowerCase().indexOf(keywordArr.get(j));
                                                     bookAuthor = bookAuthor.replace(bookAuthor.substring(index,(index + keywordArr.get(j).length())),
                                                                "<b>"
                                                                + bookAuthor.substring(index,(index + keywordArr.get(j).length()))
                                                                + "</b>");
                                                     temStr += keywordArr.get(j);
					                            }

				                            }
			                            }
                                    }

                               }
                               if(!"null".equals(keywordList.get(3))){
                                    if(bookPublisher.toLowerCase().indexOf(keywordList.get(3)) != -1){

                                         int index = 0;
                                         index = bookPublisher.toLowerCase().indexOf(keywordList.get(3));
                                         bookPublisher = bookPublisher.replace(bookPublisher.substring(index,(index + keywordList.get(3).length())),
                                                         "<b>"
                                                         + bookPublisher.substring(index,(index + keywordList.get(3).length()))
                                                         + "</b>");
                 
                                   }else if(keywordList.get(3).indexOf(" ") != -1){
                                        
                                        StringTokenizer temst = new StringTokenizer(keywordList.get(3), " ");
			                            ArrayList<String> keywordArr = new ArrayList<String>();
			                            while (temst.hasMoreElements()) {
			                               String temstr = temst.nextToken();
				                           if(null != temstr)
				                               keywordArr.add(temstr.trim());
			                            }

			                            String temStr = "";
			                            for (int j = 0; j < keywordArr.size(); j++) {
				                             if (bookPublisher.toLowerCase().indexOf(keywordArr.get(j)) != -1) {
				                             
				                             	if(temStr.toLowerCase().indexOf(keywordArr.get(j)) == -1){
					                                 int index = 0;
                                                     index = bookPublisher.toLowerCase().indexOf(keywordArr.get(j));
                                                     bookPublisher = bookPublisher.replace(bookPublisher.substring(index,(index + keywordArr.get(j).length())),
                                                                "<b>"
                                                                + bookPublisher.substring(index,(index + keywordArr.get(j).length()))
                                                                + "</b>");
                                                     temStr += keywordArr.get(j);
					                            }

				                            }
			                            }
                                    }
                               }
                       }else {
                             if("name".equals(searchKind)||"all".equals(searchKind)){

					               String temStr = "";
					               for (int j = 0; j < keywordList.size(); j++) {
						                if (bookName.toLowerCase().indexOf(keywordList.get(j)) != -1) {
						                        if(temStr.toLowerCase().indexOf(keywordList.get(j)) == -1){
						                              int index = 0;
	                                                  index = bookName.toLowerCase().indexOf(keywordList.get(j));
	                                                  bookName = bookName.replace(bookName.substring(index,(index + keywordList.get(j).length())),
	                                                                              "<b>" + bookName.substring(index,(index + keywordList.get(j).length())) + "</b>");
	                                                  temStr += keywordList.get(j);
						                           }	
						                  }
					                 }              
                             }
                             if("author".equals(searchKind)||"all".equals(searchKind)){
	                              
					               String temStr = "";
					               for (int j = 0; j < keywordList.size(); j++) {
						               if (bookAuthor.toLowerCase().indexOf(keywordList.get(j)) != -1) {
						                        if(temStr.toLowerCase().indexOf(keywordList.get(j)) == -1){
						                              int index = 0;
	                                                  index = bookAuthor.toLowerCase().indexOf(keywordList.get(j));
	                                                  bookAuthor = bookAuthor.replace(bookAuthor.substring(index,(index + keywordList.get(j).length())),
	                                                               "<b>" + bookAuthor.substring(index,(index + keywordList.get(j).length())) + "</b>");
	                                                  temStr += keywordList.get(j);
						                       }	
						               }
					             }

                              }
                              if("publisher".equals(searchKind)||"all".equals(searchKind)){
	                              
					                  String temStr = "";
					                  for (int j = 0; j < keywordList.size(); j++) {
						                   if (bookPublisher.toLowerCase().indexOf(keywordList.get(j)) != -1) {
						                         if(temStr.toLowerCase().indexOf(keywordList.get(j)) == -1){
						                               int index = 0;
	                                                   index = bookPublisher.toLowerCase().indexOf(keywordList.get(j));
	                                                   bookPublisher = bookPublisher.replace(bookPublisher.substring(index,(index + keywordList.get(j).length())),
	                                                                   "<b>" + bookPublisher.substring(index,(index + keywordList.get(j).length())) + "</b>");
	                                                   temStr += keywordList.get(j);
						                         }	
						                  }
					                 }
                              }
                              
                            }

							out.print("<table width=" + "\"" + "100%" + "\"" + " class="
							+ "\"" + "resulttable" + "\"" + " cellpadding=" + "\"" + "2"
							+ "\"" + " cellspacing=" + "\"" + "2" + "\"" + ">");
							out.print("<tr>");
							out.print("<td rowspan=" + "\"" + "11" + "\""  + "top" + "\"" + "width=" + "\"" + "11%" + "\""+ "><img src='"
							+ bookImage+ "'"+ "width=" + "\"" + "120" + "\"" + "height=" + "\"" + "165"+ "\""
							+ "border=" + "\"" + "1" + "\"" + "hspace=" + "\"" + "0" + "\""+ "vspace=" + "\"" + "0" + "\"" + ">");
							out.print("</td>");

							if (id != null) {
								out.print("<td valign=" + "\"" + "bottom" + "\""
								+ " height=" + "\"" + "24" + "\"" + "width=" + "\""
								+ "89%" + "\"" + "><strong><font color=" + "\""
								+ "#339900" + "\"" + ">" + "图书名称:"
								+ "</font></strong>" + "<strong><font color=blue >" + bookName + "</font></strong>");
								out.print("</td>");
								out.print("</tr>");

								out.print("<tr><td>");
								
								ArrayList<String> authorList = new ArrayList<String>(); 
								if(bookAuthor.indexOf(" ")!=-1){
							        StringTokenizer temst = new StringTokenizer(bookAuthor, " ");
			                        while (temst.hasMoreElements()) {
			                            String temstr = temst.nextToken();
				                        if(null != temstr)
				                            authorList.add(temstr.trim());
			                        }
			                    }else{
			                        authorList.add(bookAuthor);
			                    }
                                if(authorList.size()>0){
								    String authorStr = "";
								    for(Iterator it = authorList.iterator();it.hasNext();){
								        String tempStr = (String)it.next();
								        if(tempStr.indexOf("<b>")==-1&&!"暂无相关信息".equals(tempStr))
								            authorStr = authorStr + "<a href=Search.do?keyword="
								                      + URLEncoder.encode(tempStr, "UTF-8") 
			    		                              + "&searchkind=author>"
			    		                              + tempStr + "</a>&nbsp;&nbsp;";
			    		                else 
			    		                    authorStr += tempStr + "&nbsp;&nbsp;" ;
								    }
								    out.print("作者 :                  " + authorStr);
								}
								out.print("</td></tr>");

                                out.print("<tr><td>");
                                ArrayList<String> publisherList = new ArrayList<String>(); 
                                if(bookPublisher.indexOf(" ")!=-1){
							        StringTokenizer temst = new StringTokenizer(bookPublisher, " ");
			                        while (temst.hasMoreElements()) {
			                            String temstr = temst.nextToken();
				                        if(null != temstr)
				                            publisherList.add(temstr.trim());
			                        }
			                    }else{
			                        publisherList.add(bookPublisher);
			                    }
                                if(publisherList.size()>0){
								    String publisherStr = "";
								    for(Iterator it = publisherList.iterator();it.hasNext();){
								        String tempStr = (String)it.next();
								        if(!"publisher".equals(searchKind)&&tempStr.indexOf("<b>")==-1&&!"暂无相关信息".equals(tempStr))
								            publisherStr = publisherStr + "<a href=Search.do?keyword="
								                      + URLEncoder.encode(tempStr, "UTF-8") 
			    		                              + "&searchkind=author>"
			    		                              + tempStr + "</a>&nbsp;&nbsp;";
			    		                else 
			    		                    publisherStr += tempStr + "&nbsp;&nbsp;";
								    }
								    out.print("出版社 :                  " + publisherStr);
								}
								out.print("</td></tr>");

								out.print("<tr><td>");
								out.print("出版时间 :                 " 
							            + bookPublishTime);
								out.print("</td></tr>");

								out.print("<tr><td>");
								out.print("ISBN :                    " 
								        + bookISBN );
								out.print("</td></tr>");

								out.print("<tr><td>");
								out.print("市场定价 :                   ¥" + bookFixPrice);
								out.print("</td></tr>");
								
								if(null != bookProspectus && !"".equals(bookProspectus)){
								    out.print("<tr><td>");
								    out.print("内容简介 :                   " + bookProspectus);
								    out.print("</td></tr>");
								}
								
								out.print("<tr><td>");
								out.print("<div id='" + id + "' onmouseover='openDiv(\""
								+ id + "\"" + ",\"" + id

⌨️ 快捷键说明

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