📄 booksale_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import common.BookInfoBean;
import bookadmin.selectBook;
import java.util.*;
import ConnBean.ConnBean;
import java.sql.*;
public final class BookSale_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
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;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
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("\n");
out.write("\n");
out.write("\n");
out.write("<html>\n");
out.write("<head>\n");
out.write("<title>\n");
out.write("BookSale\n");
out.write("</title>\n");
out.write("</head>\n");
out.write("<body bgcolor=\"#ffffff\">\n");
out.write("\n");
out.write("<h1 align=\"center\">\n");
out.write("商品销售页\n");
out.write("</h1>\n");
BookInfoBean objBookInfo; selectBook objselectBook=new selectBook(); Vector vec=new Vector(); vec=objselectBook.SelectBook(); ConnBean db=new ConnBean(); while(vec.size()!=0) { objBookInfo=new BookInfoBean(); objBookInfo=(BookInfoBean)vec.get(0);
out.write("\n");
out.write(" <table width=\"100%\">\n");
out.write(" <tr><td align=\"center\" valign=\"middle\" width=\"100%\" height=\"100%\">\n");
out.write(" <form name=\"BookSaleform\" method=\"POST\" action=\"/Main/shoppingcar\">\n");
out.write("<table width=\"38%\" border=\"1\">\n");
out.write(" <tr>\n");
out.write(" <td colspan=\"3\">商品信息</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td width=\"24%\" align=\"right\">图书编号</td>\n");
out.write(" <td width=\"43%\">");
out.println(""+objBookInfo.getBookNo());
out.write("</td>\n");
out.write(" <td width=\"33%\" rowspan=\"7\" valign=\"middle\" align=\"center\"><img alt=\"\" src=\"");
out.print(objBookInfo.getImage());
out.write("\" width=\"150\" height=\"200\"/></td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">书名</td>\n");
out.write(" <td width=\"43%\">");
out.println(""+objBookInfo.getBookName());
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">图书类别</td>\n");
out.write(" <td width=\"43%\">");
out.print(db.getTypeName(objBookInfo.getBookType()) );
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">作者</td>\n");
out.write(" <td width=\"43%\">");
out.println(""+objBookInfo.getAuthor());
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">出版社</td>\n");
out.write(" <td width=\"43%\">");
out.println(""+objBookInfo.getBook_concern());
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">单价</td>\n");
out.write(" <td width=\"43%\">");
out.println(""+objBookInfo.getPrice());
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td align=\"right\">购买数量</td>\n");
out.write(" <td width=\"43%\">\n");
out.write(" <select name=\"hBookCount\">\n");
out.write(" ");
for(int i=0;i<=objBookInfo.getBookCount();i++) out.println("<option value="+i+">"+i+"</option>");
out.write("\n");
out.write(" </select></td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td height=\"117\" align=\"center\"><p>简</p>\n");
out.write(" <p>介</p></td>\n");
out.write(" <td colspan=\"2\">");
out.println(""+objBookInfo.getIntroduc());
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" <tr>\n");
out.write(" <td colspan=\"3\" align=\"right\"><input type=\"submit\" name=\"Submit\" value=\"加入购物车\"></td>\n");
out.write(" </tr>\n");
out.write("</table>\n");
out.write("<input type=\"hidden\" name=\"hBookNo\" value=\"");
out.print(objBookInfo.getBookNo() );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hBookName\" value=\"");
out.print(objBookInfo.getBookName() );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hBookType\" value=\"");
out.print(String.valueOf(objBookInfo.getBookType()) );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hAuthor\" value=\"");
out.print(objBookInfo.getAuthor() );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hBook_concern\" value=\"");
out.print(objBookInfo.getBook_concern() );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hPrice\" value=\"");
out.print(objBookInfo.getPrice() );
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"hImage\" value=\"");
out.print(objBookInfo.getImage());
out.write("\"/>\n");
out.write("<input type=\"hidden\" name=\"action\" value=\"ADD\"/>\n");
out.write("</form>\n");
out.write(" ");
vec.remove(0); }
out.write("\n");
out.write(" </td>\n");
out.write("</tr>\n");
out.write(" </table>\n");
out.write("</body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -