?? list_0002ejsp_jsp.java
字號:
import thisjsp.listBean.*;
import
java.sql.*;
import
com.borland.dx.sql.dataset.QueryDataSet;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class list_0002ejsp_jsp extends HttpJspBase {
// begin [file="/list.jsp";from=(12,0);to=(12,72)]
// end
static {
}
public list_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=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/list.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/list.jsp";from=(3,60);to=(12,0)]
out.write("\r\n\r\n<html>\r\n<head>\r\n<title>\r\nlist\r\n</title>\r\n</head>\r\n<body link=\"#551A8B\" vlink=\"#0000EE\" alink=\"#FF0000\">\r\n");
// end
// begin [file="/list.jsp";from=(12,0);to=(12,72)]
thisjsp.listBean listBeanId = null;
boolean _jspx_speciallistBeanId = false;
synchronized (session) {
listBeanId= (thisjsp.listBean)
pageContext.getAttribute("listBeanId",PageContext.SESSION_SCOPE);
if ( listBeanId == null ) {
_jspx_speciallistBeanId = true;
try {
listBeanId = (thisjsp.listBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "thisjsp.listBean");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"thisjsp.listBean", exc);
}
pageContext.setAttribute("listBeanId", listBeanId, PageContext.SESSION_SCOPE);
}
}
if(_jspx_speciallistBeanId == true) {
// end
// begin [file="/list.jsp";from=(12,0);to=(12,72)]
}
// end
// HTML // begin [file="/list.jsp";from=(12,72);to=(13,0)]
out.write("\r\n");
// end
// begin [file="/list.jsp";from=(13,0);to=(13,50)]
JspRuntimeLibrary.introspect(pageContext.findAttribute("listBeanId"), request);
// end
// HTML // begin [file="/list.jsp";from=(13,50);to=(37,10)]
out.write("\r\n<form name=\"form1\" method=\"post\" action=\"\">\r\n<div align=\"center\">\r\n \r\n <table width=\"94%\" border=\"0\">\r\n <tr align=\"center\"> \r\n <td colspan=\"9\" height=\"13\" bgcolor=\"#0066bb\"><font size=\"+3\"><b><font color=\"#FFFFFF\">高校圖書館網上查書系統</font></b></font></td>\r\n </tr>\r\n <tr align=\"center\">\r\n <td colspan=\"9\" height=\"14\" bgcolor=\"#0066bb\"><font color=\"#FFFFFF\">由網址:<a href=\"http://yuehui.cn.gs\">http://yuehui.cn.gs</a>提供</font></td>\r\n </tr>\r\n <tr> \r\n <td colspan=\"9\" height=\"19\">按→ \r\n <select name=\"select\">\r\n <option selected>書名</option>\r\n <option>序號</option>\r\n <option>出版社</option>\r\n </select>\r\n 查詢: \r\n <input type=\"text\" name=\"textValues\" size=\"15\" maxlength=\"100\"> <input type=\"submit\" name=\"bt\" value=\"查詢\"> \r\n <input type=\"submit\" name=\"bt\" value=\"全部瀏覽\"> <input type=\"submit\" name=\"bt\" value=\"第一頁\"> \r\n <input type=\"submit\" name=\"bt\" value=\"下一頁\"> <input type=\"submit\" name=\"bt\" value=\"上一頁\"> \r\n <input type=\"submit\" name=\"bt\" value=\"最后頁\"> <font size=\"5\"> </font> \r\n <!----------------------------------------------------------------------------->\r\n ");
// end
// begin [file="/list.jsp";from=(37,12);to=(92,2)]
try
{
if ("POST".equals(request.getMethod()))
{
String b=request.getParameterValues("bt")[0];//獲取單擊按鈕名
b=new String(b.getBytes("ISO-8859-1"));
String optSlt=request.getParameterValues("select")[0];//獲取查詢條件
optSlt=new String(optSlt.getBytes("ISO-8859-1"));
String textValues=request.getParameterValues("textValues")[0];
textValues=new String(textValues.getBytes("ISO-8859-1"));
if (b.equals("查詢"))
{
if (optSlt.equals("書名"))
{
listBeanId.getListResult(" name like '%"+textValues.trim()+"%'",out);
}
else
if (optSlt.equals("序號"))
{
listBeanId.getListResult(" id like '%"+textValues.trim()+"%'",out);
}
else
{
listBeanId.getListResult(" danWei like '%"+textValues.trim()+"%'",out);
}
}
else
if (b.equals("全部瀏覽"))
{
listBeanId.getListResult(out);//獲得初始結果集
}
else
if (b.equals("第一頁"))
{
listBeanId.firstPag(out);
}
else
if (b.equals("下一頁"))
{
listBeanId.nextPage(out);
}
else
if (b.equals("上一頁"))
{
listBeanId.previousPage(out);
}
else//最后一頁
if (b.equals("最后頁"))
{
listBeanId.lastPage(out);
}
// end
// HTML // begin [file="/list.jsp";from=(92,4);to=(105,6)]
out.write(" </td>\r\n </tr>\r\n <tr> \r\n <td width=\"35\" height=\"17\" bgcolor=\"#0066bb\"> <div align=\"center\"><font color=\"#FFFFFF\"><b>序號</b></font></div></td>\r\n <td height=\"17\" bgcolor=\"#0066bb\" colspan=\"3\"> <div align=\"center\"><font color=\"#FFFFFF\"><b>書名 (詳情請單擊書名)</b></font></div></td>\r\n <td height=\"17\" bgcolor=\"#0066bb\" width=\"100\"> <div align=\"center\"><font color=\"#FFFFFF\"><b>作者</b></font></div></td>\r\n <td height=\"17\" bgcolor=\"#0066bb\" colspan=\"2\"> <div align=\"center\"><font color=\"#FFFFFF\"><b>單價</b></font></div></td>\r\n <td height=\"17\" bgcolor=\"#0066bb\" colspan=\"3\"> <div align=\"center\"><font color=\"#FFFFFF\"><b>出版單位</b></font></div></td>\r\n </tr>\r\n <tr bgcolor=\"#CCCCCC\"> \r\n <td colspan=\"9\" height=\"1\"></td>\r\n </tr>\r\n <!----------------------------------------------------------------------------->\r\n ");
// end
// begin [file="/list.jsp";from=(105,8);to=(107,0)]
listBeanId.getListPage(out);
// end
// HTML // begin [file="/list.jsp";from=(107,2);to=(112,0)]
out.write("\r\n <!----------------------------------------------------------------------------->\r\n </table>\r\n </div>\r\n<!----------------------------------------------------------------------------->\r\n");
// end
// begin [file="/list.jsp";from=(112,2);to=(119,0)]
}
}
catch(Exception ee)
{
out.println("Error!");
}
// end
// HTML // begin [file="/list.jsp";from=(119,2);to=(124,0)]
out.write("\r\n<!----------------------------------------------------------------------------->\r\n</form>\r\n</body>\r\n</html>\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 + -