📄 bookmanage_0002ejsp_jsp.java
字号:
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class bookManage_0002ejsp_jsp extends HttpJspBase {
static {
}
public bookManage_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="/bookManage.jsp";from=(0,52);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/bookManage.jsp";from=(1,30);to=(2,0)]
out.write("\r\n");
// end
// HTML // begin [file="/bookManage.jsp";from=(2,31);to=(8,0)]
out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>图书管理</title>\r\n<style type=\"text/css\"></style></head>\r\n");
// end
// begin [file="/bookManage.jsp";from=(8,2);to=(8,47)]
if(session.getAttribute("adminId")==null) {
// end
// HTML // begin [file="/bookManage.jsp";from=(8,49);to=(9,0)]
out.write("\r\n");
// end
// begin [file="/bookManage.jsp";from=(9,0);to=(9,35)]
if (true) {
out.clear();
String _jspx_qfStr = "";
pageContext.forward("notLogin.jsp" + _jspx_qfStr);
return;
}
// end
// HTML // begin [file="/bookManage.jsp";from=(9,35);to=(10,0)]
out.write("\r\n");
// end
// begin [file="/bookManage.jsp";from=(10,2);to=(10,12)]
} else {
// end
// HTML // begin [file="/bookManage.jsp";from=(10,14);to=(34,0)]
out.write("\r\n<body>\r\n<div id=\"pagecell1\" style=\"background-image:url(images/bg1.gif)\">\r\n<table width=\"100%\" border=\"0\" background=\"images/bg1.gif\">\r\n <tr valign=\"top\" style=\"background-image:url(images/bg1.gif)\">\r\n <td width=\"81%\" >\r\n<div class=\"book\">\r\n<form name=\"form\" method=\"post\" action=\"DeleteBook.jsp\">\r\n\t <table width=\"100%\" border=\"0\" >\r\n <tr>\r\n <td height=\"11\" bgcolor=\"#FFFFFF\" >\r\n\t <table width=\"100%\" border=\"0\" >\r\n <tr>\r\n <td width=\"5%\"><div align=\"center\">删除</div></td>\r\n <td width=\"8%\"><div align=\"center\">ID</div></td>\r\n <td width=\"21%\"><div align=\"center\">书名</div></td>\r\n <td width=\"20%\"><div align=\"center\">作者</div></td>\r\n <td width=\"20%\"><div align=\"center\">出版社</div></td>\r\n <td width=\"10%\"><div align=\"center\">单价</div></td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"8\"><hr></td>\r\n </tr>\r\n\r\n");
// end
// begin [file="/bookManage.jsp";from=(34,2);to=(52,0)]
String pg="";
if(request.getParameter("pg")==null){
pg="1";
}else{pg=request.getParameter("pg");
}
int index=(Integer.parseInt(pg)-1)*30;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
Connection con=DriverManager.getConnection("jdbc:odbc:Shopping");
Statement stmt=con.createStatement();
ResultSet resultset=stmt.executeQuery("select * from book");
for(int i=0;i<index;i++){
resultset.next();
}
int n=0;
while(resultset.next()&&n<30){
n++;
int bookid=resultset.getInt("book_ID");
// end
// HTML // begin [file="/bookManage.jsp";from=(52,2);to=(55,46)]
out.write("\r\n <tr>\r\n <td ><div align=\"center\">\r\n <input name=\"bookid\" type=\"checkbox\" value=\"");
// end
// begin [file="/bookManage.jsp";from=(55,49);to=(55,55)]
out.print(bookid);
// end
// HTML // begin [file="/bookManage.jsp";from=(55,57);to=(56,7)]
out.write("\"></div></td>\r\n <td >");
// end
// begin [file="/bookManage.jsp";from=(56,10);to=(56,16)]
out.print(bookid);
// end
// HTML // begin [file="/bookManage.jsp";from=(56,18);to=(57,6)]
out.write("</td>\r\n <td>");
// end
// begin [file="/bookManage.jsp";from=(57,9);to=(57,42)]
out.print(resultset.getString("book_name") );
// end
// HTML // begin [file="/bookManage.jsp";from=(57,44);to=(58,6)]
out.write("</a></td>\r\n <td>");
// end
// begin [file="/bookManage.jsp";from=(58,9);to=(58,39)]
out.print(resultset.getString("author") );
// end
// HTML // begin [file="/bookManage.jsp";from=(58,41);to=(59,5)]
out.write("</td>\r\n <td>");
// end
// begin [file="/bookManage.jsp";from=(59,8);to=(59,48)]
out.print(resultset.getString("publishing_house") );
// end
// HTML // begin [file="/bookManage.jsp";from=(59,50);to=(60,13)]
out.write("</td>\r\n <td>¥ ");
// end
// begin [file="/bookManage.jsp";from=(60,16);to=(60,45)]
out.print(resultset.getString("value") );
// end
// HTML // begin [file="/bookManage.jsp";from=(60,47);to=(62,0)]
out.write("</td>\r\n</tr>\r\n");
// end
// begin [file="/bookManage.jsp";from=(62,2);to=(64,0)]
}
// end
// HTML // begin [file="/bookManage.jsp";from=(64,2);to=(74,1)]
out.write("\r\n </table>\r\n</td></tr></table>\r\n<table width=\"100%\" border=\"0\">\r\n<tr>\r\n<td width=\"25%\"><input type=\"submit\" name=\"Submit\" value=\"删除\">\r\n <a href=\"addBook.jsp\">添加图书</a></td>\r\n<td width=\"25%\">\r\n <a href=\"adminMenu.jsp\">返回 </a></td>\r\n <td width=\"75%\">\r\n ");
// end
// begin [file="/bookManage.jsp";from=(74,3);to=(78,24)]
String pre="/bookshop/bookManage.jsp?pg="+Integer.toString(index/30);
String aft="/bookshop/bookManage.jsp?pg="+Integer.toString(index/30+2);
if(pg.equals("1")){
if(resultset.next()){
// end
// HTML // begin [file="/bookManage.jsp";from=(78,26);to=(79,32)]
out.write("\r\n <div align=\"right\">上一页/<a href=");
// end
// begin [file="/bookManage.jsp";from=(79,35);to=(79,40)]
out.print( aft );
// end
// HTML // begin [file="/bookManage.jsp";from=(79,42);to=(80,1)]
out.write(">下一页</a></div>\r\n ");
// end
// begin [file="/bookManage.jsp";from=(80,3);to=(80,9)]
}else{
// end
// HTML // begin [file="/bookManage.jsp";from=(80,11);to=(82,1)]
out.write("\r\n <div align=\"right\">上一页/下一页</div>\r\n ");
// end
// begin [file="/bookManage.jsp";from=(82,3);to=(84,23)]
}
} else {
if(resultset.next()){
// end
// HTML // begin [file="/bookManage.jsp";from=(84,25);to=(85,27)]
out.write("\r\n<div align=\"right\"><a href=");
// end
// begin [file="/bookManage.jsp";from=(85,30);to=(85,35)]
out.print( pre );
// end
// HTML // begin [file="/bookManage.jsp";from=(85,37);to=(85,54)]
out.write(">上一页</a>/<a href=");
// end
// begin [file="/bookManage.jsp";from=(85,57);to=(85,62)]
out.print( aft );
// end
// HTML // begin [file="/bookManage.jsp";from=(85,64);to=(86,0)]
out.write(">下一页</a></div>\r\n");
// end
// begin [file="/bookManage.jsp";from=(86,2);to=(86,12)]
} else {
// end
// HTML // begin [file="/bookManage.jsp";from=(86,14);to=(87,27)]
out.write("\r\n<div align=\"right\"><a href=");
// end
// begin [file="/bookManage.jsp";from=(87,30);to=(87,35)]
out.print( pre );
// end
// HTML // begin [file="/bookManage.jsp";from=(87,37);to=(88,0)]
out.write(">上一页</a>/下一页</div>\r\n");
// end
// begin [file="/bookManage.jsp";from=(88,2);to=(92,1)]
}
}
}catch(Exception e)
{ out.println(e);}
// end
// HTML // begin [file="/bookManage.jsp";from=(92,3);to=(100,0)]
out.write("\r\n</td></tr>\r\n</table>\r\n</form>\r\n</div></td></tr>\r\n</table>\r\n</div><br>\r\n</body>\r\n");
// end
// begin [file="/bookManage.jsp";from=(100,2);to=(100,5)]
}
// end
// HTML // begin [file="/bookManage.jsp";from=(100,7);to=(104,0)]
out.write("\r\n</html>\r\n\r\n\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -