📄 booklist_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import com.bookshop.bean.*;
import com.bookshop.bean.BookClass;
public final class booklist_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
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=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, 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("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
com.bookshop.bean.Books book = null;
synchronized (_jspx_page_context) {
book = (com.bookshop.bean.Books) _jspx_page_context.getAttribute("book", PageContext.PAGE_SCOPE);
if (book == null){
book = new com.bookshop.bean.Books();
_jspx_page_context.setAttribute("book", book, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.bookshop.dao.Booksmn book_list = null;
synchronized (_jspx_page_context) {
book_list = (com.bookshop.dao.Booksmn) _jspx_page_context.getAttribute("book_list", PageContext.PAGE_SCOPE);
if (book_list == null){
book_list = new com.bookshop.dao.Booksmn();
_jspx_page_context.setAttribute("book_list", book_list, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.bookshop.dao.BookclassList classlist = null;
synchronized (_jspx_page_context) {
classlist = (com.bookshop.dao.BookclassList) _jspx_page_context.getAttribute("classlist", PageContext.PAGE_SCOPE);
if (classlist == null){
classlist = new com.bookshop.dao.BookclassList();
_jspx_page_context.setAttribute("classlist", classlist, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
int pages = 1;
String mesg = "";
if (request.getParameter("page") != null
&& !request.getParameter("page").equals(""))
{
String requestpage = request.getParameter("page");
try
{
pages = Integer.parseInt(requestpage);
} catch (Exception e)
{
mesg = "你要找的页码错误!";
}
book_list.setPage(pages);
}
String classid = request.getParameter("classid");
String classname = "";
String keyword = request.getParameter("keyword");
if (classid == null)
classid = "";
if (keyword == null)
keyword = "";
keyword = book_list.getGbk(keyword);
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("\t<head>\r\n");
out.write("\t\t<title>51网上书店 选购图书</title>\r\n");
out.write("\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("\t\t<style>a{TEXT-DECORATION:none}a:hover{TEXT-DECORATION:underline}</style>\r\n");
out.write("\t\t<script language=\"JavaScript\">\r\n");
out.write("\t\tsetInterval(\"a.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());\",1000);\r\n");
out.write("\t\t</script>\r\n");
out.write("\t\t<script language=\"javascript\">\r\n");
out.write("\t\t\tfunction openScript(url,name, width, height)\r\n");
out.write("\t\t\t{\r\n");
out.write("\t\t\t\tvar Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t</script>\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"books.css\" type=\"text/css\">\r\n");
out.write("\t\t<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write(".style2 {color: #000000}\r\n");
out.write(".style14 {color: #3366FF}\r\n");
out.write(".style16 {font-size: 18px; color: #3366FF;}\r\n");
out.write("-->\r\n");
out.write("</style>\r\n");
out.write("\t</head>\r\n");
out.write("\r\n");
out.write("\t<body text=\"#000000\">\r\n");
out.write("\t\t<div align=\"center\">\r\n");
out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write("\t\t\t\t<tr>\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t<td align=\"center\"><img src=\"images/title.jpg\" width=\"750\" height=\"100\"></td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\r\n");
out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" >\r\n");
out.write("\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t <td width=\"100\" height=\"30\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"index.jsp\" class=\"style14\">首页</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"booklist.jsp\" class=\"style14\">在线购物</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"shoperlist.jsp\" class=\"style14\">我的购物车</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"login.jsp\" class=\"style14\">用户登录</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"manage/login.jsp\" class=\"style14\">网站管理</a></td>\r\n");
out.write("\t\t\t\t <td width=\"250\" align=\"center\" background=\"images/qntj.jpg\"><div id=\"a\"><span class=\"style7\"></span></div></td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t </table>\r\n");
out.write("\t\t \r\n");
out.write("\t\t\t<table width=\"750\" height=\"414\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#33CCFF\">\r\n");
out.write("\t\t\t\t<tr valign=\"top\">\r\n");
out.write("\t\t\t\t\t<td width=\"150\" height=\"412\">\r\n");
out.write("\t\t\t\t\t\t<table width=\"150\" class=\"style17\" height=\"67\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" align=\"center\">\r\n");
out.write("\t\t\t\t\t\t\t<tr align=\"center\">\r\n");
out.write("\t\t\t\t\t\t\t\t<td width=\"123\" height=\"44\" background=\"images/qntj.jpg\" align=\"center\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<span class=\"style16\">本店图书分类</span>\t\t\t\t\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t\t </td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\t");
if (classlist.excute())
{
for (int i = 0; i < classlist.getClasslist().size(); i++)
{
BookClass bc = (BookClass) classlist.getClasslist().elementAt(i);
out.write("\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t\t<td height=\"20\" align=\"center\" background=\"images/qntj.jpg\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<a href=\"booklist.jsp?classid=");
out.print(bc.getId());
out.write('"');
out.write('>');
out.print(bc.getClassName());
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t </a>\r\n");
out.write("\t\t\t\t\t\t\t </td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\t");
}
}
out.write("\t\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t </table>\r\n");
out.write("\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n");
out.write("\t\t\t\t\t\t\t<form name=form1 method=POST action=\"booklist.jsp\">\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t\t<td height=\"28\" align=center background=\"images/qntj.jpg\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<span class=\"style16\">图书查询</span>\r\n");
out.write("\t\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t\t<td height=\"35\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t <span class=\"style14\">关键字 </span>\r\n");
out.write("\t\t\t\t\t\t\t\t\t <input type=\"text\" name=\"keyword\" size=\"12\" maxlength=\"40\" value=\"");
out.print(keyword);
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t </td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t\t<td height=\"36\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<span class=\"style14\">类 别</span>\r\n");
out.write("\t\t\t\t\t\t\t\t\t <SELECT NAME=\"classid\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<option value=\"\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t所有类别\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</option>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t");
for (int i = 0; i < classlist.getClasslist().size(); i++)
{
BookClass bc = (BookClass) classlist.getClasslist()
.elementAt(i);
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<option value=\"");
out.print(bc.getId());
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t");
out.print(bc.getClassName());
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -