📄 newbook_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 NewBook_0002ejsp_jsp extends HttpJspBase {
static {
}
public NewBook_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="/NewBook.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/NewBook.jsp";from=(1,30);to=(2,0)]
out.write("\r\n");
// end
// HTML // begin [file="/NewBook.jsp";from=(2,31);to=(7,0)]
out.write("\r\n<html>\r\n<body background=\"images\\\\book1.jpg\">\r\n<table border=1 cellspacing=\"1\" cellpadding=\"1\" bordercolor=\"blue\">\r\n<tr><td>书名</td><td>作者</td><td>出版社</td><td><font size=\"3\" color=\"#977923\"><b>本站价格</b></font></td><td><font size=\"3\" color=\"#086306\"><b>会员价</b></font></td><td>详细</td><tr>\r\n");
// end
// begin [file="/NewBook.jsp";from=(7,2);to=(23,0)]
String sql="select * from book where book_ID between 1 and 4 ";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
Connection con=DriverManager.getConnection("jdbc:odbc:Shopping");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(sql);
while(rs.next()){
int book_ID=rs.getInt("book_ID") ;
String book_name=rs.getString("book_name") ;
session.setAttribute("bookname",book_name);
String author=rs.getString("author") ;
String publishing_house=rs.getString("publishing_house") ;
float T_value=(float)rs.getDouble("T_value") ;
float vip_value=(float)rs.getDouble("vip_value") ;
// end
// HTML // begin [file="/NewBook.jsp";from=(23,2);to=(25,41)]
out.write("\r\n<tr>\r\n<td><font size=\"3\" color=\"blue\"><a href=\"");
// end
// begin [file="/NewBook.jsp";from=(25,44);to=(25,68)]
out.print(request.getContextPath());
// end
// HTML // begin [file="/NewBook.jsp";from=(25,70);to=(25,96)]
out.write("/bookdetails.jsp?bookname=");
// end
// begin [file="/NewBook.jsp";from=(25,99);to=(25,108)]
out.print(book_name);
// end
// HTML // begin [file="/NewBook.jsp";from=(25,110);to=(25,128)]
out.write("\" name=\"show\"><b>");
// end
// begin [file="/NewBook.jsp";from=(25,131);to=(25,140)]
out.print(book_name);
// end
// HTML // begin [file="/NewBook.jsp";from=(25,142);to=(26,4)]
out.write("</b></a></font></td>\r\n<td>");
// end
// begin [file="/NewBook.jsp";from=(26,7);to=(26,13)]
out.print(author);
// end
// HTML // begin [file="/NewBook.jsp";from=(26,15);to=(26,24)]
out.write("</td><td>");
// end
// begin [file="/NewBook.jsp";from=(26,27);to=(26,43)]
out.print(publishing_house);
// end
// HTML // begin [file="/NewBook.jsp";from=(26,45);to=(26,54)]
out.write("</td><td>");
// end
// begin [file="/NewBook.jsp";from=(26,57);to=(26,64)]
out.print(T_value);
// end
// HTML // begin [file="/NewBook.jsp";from=(26,66);to=(26,75)]
out.write("</td><td>");
// end
// begin [file="/NewBook.jsp";from=(26,78);to=(26,87)]
out.print(vip_value);
// end
// HTML // begin [file="/NewBook.jsp";from=(26,89);to=(27,18)]
out.write("</td>\r\n<td><form action=\"");
// end
// begin [file="/NewBook.jsp";from=(27,21);to=(27,45)]
out.print(request.getContextPath());
// end
// HTML // begin [file="/NewBook.jsp";from=(27,47);to=(27,73)]
out.write("/bookdetails.jsp?bookname=");
// end
// begin [file="/NewBook.jsp";from=(27,76);to=(27,85)]
out.print(book_name);
// end
// HTML // begin [file="/NewBook.jsp";from=(27,87);to=(29,0)]
out.write("\" method=\"post\"><input type=\"image\" src=\"images\\\\view.gif\"></form></td>\r\n</tr>\r\n");
// end
// begin [file="/NewBook.jsp";from=(29,2);to=(30,2)]
}
// end
// HTML // begin [file="/NewBook.jsp";from=(30,4);to=(31,0)]
out.write("\r\n");
// end
// begin [file="/NewBook.jsp";from=(31,2);to=(33,0)]
}
catch(Exception e){System.out.println("ktyu"+e.getMessage() ) ;}
// end
// HTML // begin [file="/NewBook.jsp";from=(33,2);to=(37,0)]
out.write("\r\n</table>\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 + -