insertbook_jsp.java
来自「图书管理系统。JSP+Struts(MVC框架)sql2000数据库」· Java 代码 · 共 208 行
JAVA
208 行
package org.apache.jsp.book;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.actionForm.BookSortForm;
import java.util.List;
public final class insertBook_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,
"", 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");
com.tool.ShowTime showTime = null;
synchronized (request) {
showTime = (com.tool.ShowTime) _jspx_page_context.getAttribute("showTime", PageContext.REQUEST_SCOPE);
if (showTime == null){
showTime = new com.tool.ShowTime();
_jspx_page_context.setAttribute("showTime", showTime, PageContext.REQUEST_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.dao.BookSortDao bookSortDao = null;
synchronized (request) {
bookSortDao = (com.dao.BookSortDao) _jspx_page_context.getAttribute("bookSortDao", PageContext.REQUEST_SCOPE);
if (bookSortDao == null){
bookSortDao = new com.dao.BookSortDao();
_jspx_page_context.setAttribute("bookSortDao", bookSortDao, PageContext.REQUEST_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.dao.BookDao bookDao = null;
synchronized (request) {
bookDao = (com.dao.BookDao) _jspx_page_context.getAttribute("bookDao", PageContext.REQUEST_SCOPE);
if (bookDao == null){
bookDao = new com.dao.BookDao();
_jspx_page_context.setAttribute("bookDao", bookDao, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>科院图书管理系统------------图书管理</title>\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<body>\r\n");
out.write("<div align=\"center\">\r\n");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../topOne.jsp", out, true);
out.write('\r');
out.write('\n');
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../topTwo.jsp", out, true);
out.write("\r\n");
out.write("<table width=\"799\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"Images/upPlace.jpg\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"21\" class=\"word_black\"> 您当前的位置-------图书管理--------入库管理</td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("<table width=\"799\" height=\"28\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"Images/operationOne.jpg\">\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td><span class=\"STYLE4\">图书入库管理</span></td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("<table width=\"799\" height=\"457\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tableBorder_B_dashed\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td valign=\"top\" ><div align=\"center\">\r\n");
out.write(" <form name=\"form\" method=\"post\" action=\"bookAction.do?method=insertBookAction\" onSubmit=\"return addBook(form)\">\r\n");
out.write("\r\n");
out.write(" <br><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FFFFFF\" bordercolordark=\"#819BBC\" bordercolorlight=\"#FFFFFF\">\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" width=\"100\" bgcolor=\"#83B9FF\" class=\"word_white\">图书编号</td>\r\n");
out.write(" <td width=\"150\"><div align=\"left\"> ");
out.print(bookDao.selectMaxIdBook());
out.write("<input type=\"hidden\" name=\"bookNumber\" value=\"");
out.print(bookDao.selectMaxIdBook());
out.write("\"></div></td>\r\n");
out.write(" <td width=\"100\" align=\"center\" bgcolor=\"#83B9FF\" class=\"word_white\">条形码</td>\r\n");
out.write(" <td width=\"150\" ><input type=\"text\" name=\"lineNumber\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" bgcolor=\"#83B9FF\" class=\"word_white\">书名</td>\r\n");
out.write(" <td><input type=\"text\" name=\"bookName\"></td>\r\n");
out.write(" <td align=\"center\" bgcolor=\"#83B9FF\" class=\"word_white\">作者</td>\r\n");
out.write(" <td><input type=\"text\" name=\"author\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" bgcolor=\"#83B9FF\" class=\"word_white\">出版社</td>\r\n");
out.write(" <td><input type=\"text\" name=\"publish\"></td>\r\n");
out.write(" <td align=\"center\" bgcolor=\"#83B9FF\" class=\"word_white\">出版次数</td>\r\n");
out.write(" <td><input type=\"text\" name=\"publishNumber\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" bgcolor=\"#83B9FF\" class=\"word_white\">书的类别</td>\r\n");
out.write(" <td>\r\n");
out.write(" <div align=\"left\"> \r\n");
out.write(" <select name=\"sortNumber\">\r\n");
out.write(" <option style=\"background:#00FFFF\">请选择</option>\r\n");
out.write(" ");
List sortList=bookSortDao.selectbookSort();
for(int sort=0;sort<sortList.size();sort++){
BookSortForm sortForm=(BookSortForm)sortList.get(sort);
out.write("\r\n");
out.write(" <option value=\"");
out.print(sortForm.getSortNumber());
out.write("\" style=\"background:#00FFFF\">");
out.print(sortForm.getSortName());
out.write("</option>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" </select>\r\n");
out.write("\r\n");
out.write(" </div></td>\r\n");
out.write(" <td bgcolor=\"#83B9FF\" class=\"word_white\">入库价格</td>\r\n");
out.write(" <td><input type=\"text\" name=\"inPirce\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" bgcolor=\"#83B9FF\" class=\"word_white\">售出单价</td>\r\n");
out.write(" <td><input type=\"text\" name=\"singlePirce\"></td>\r\n");
out.write(" <td align=\"center\" bgcolor=\"#83B9FF\" class=\"word_white\">入库数量</td>\r\n");
out.write(" <td><input type=\"text\" name=\"bookSum\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td height=\"30\" bgcolor=\"#83B9FF\" class=\"word_white\">操作员</td>\r\n");
out.write(" <td><div align=\"left\"> ");
out.print(session.getAttribute("account"));
out.write("\r\n");
out.write(" <input type=\"hidden\" name=\"man\" value=\"");
out.print(session.getAttribute("account"));
out.write("\">\r\n");
out.write(" </div></td>\r\n");
out.write(" <td bgcolor=\"#83B9FF\" class=\"word_white\">入库时间</td>\r\n");
out.write(" <td><div align=\"left\"> ");
out.print(showTime.showCurrentTime());
out.write("\r\n");
out.write(" <input type=\"hidden\" name=\"creatime\" value=\"");
out.print(showTime.showCurrentTime());
out.write("\">\r\n");
out.write(" </div></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write("\t\t\t<br>\r\n");
out.write("\r\n");
out.write(" <input type=\"submit\" name=\"Submit2\" value=\"添加\"> \r\n");
out.write(" <input type=\"reset\" name=\"Submit\" value=\"清除\"> \r\n");
out.write(" <input type=\"button\" name=\"back\" value=\"返回\" onClick=\"javascript:history.go(-1);\">\r\n");
out.write("\r\n");
out.write(" </form>\r\n");
out.write(" </div></td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../bottom.jsp", out, true);
out.write("\r\n");
out.write("</div>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\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 + =
减小字号Ctrl + -
显示快捷键?