?? resultshow.jsp
字號:
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> ";
else
authorStr += tempStr + " " ;
}
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> ";
else
publisherStr += tempStr + " ";
}
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 + -