?? delproduct_0002ejsp_jsp.java
字號(hào):
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class delProduct_0002ejsp_jsp extends HttpJspBase {
// begin [file="/delProduct.jsp";from=(13,0);to=(13,96)]
// end
static {
}
public delProduct_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();
// begin [file="/delProduct.jsp";from=(0,2);to=(9,0)]
/**
* Title: 商店購(gòu)物管理系統(tǒng)的完整實(shí)現(xiàn)
* Description: 教學(xué)示范
* Copyright: Copyright (c) 2003
* Company: 北京師范大學(xué)計(jì)算機(jī)系
* @author 孫一林
* @version 1.0
*/
// end
// HTML // begin [file="/delProduct.jsp";from=(9,2);to=(10,0)]
out.write("\r\n");
// end
// HTML // begin [file="/delProduct.jsp";from=(10,48);to=(12,0)]
out.write("\r\n<html>\r\n");
// end
// HTML // begin [file="/delProduct.jsp";from=(12,30);to=(13,0)]
out.write("\r\n");
// end
// begin [file="/delProduct.jsp";from=(13,0);to=(13,96)]
shopmanagesystem.shopManageSystemBean shopManageBean = null;
boolean _jspx_specialshopManageBean = false;
synchronized (session) {
shopManageBean= (shopmanagesystem.shopManageSystemBean)
pageContext.getAttribute("shopManageBean",PageContext.SESSION_SCOPE);
if ( shopManageBean == null ) {
_jspx_specialshopManageBean = true;
try {
shopManageBean = (shopmanagesystem.shopManageSystemBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "shopmanagesystem.shopManageSystemBean");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"shopmanagesystem.shopManageSystemBean", exc);
}
pageContext.setAttribute("shopManageBean", shopManageBean, PageContext.SESSION_SCOPE);
}
}
if(_jspx_specialshopManageBean == true) {
// end
// begin [file="/delProduct.jsp";from=(13,0);to=(13,96)]
}
// end
// HTML // begin [file="/delProduct.jsp";from=(13,96);to=(13,98)]
out.write(" ");
// end
// begin [file="/delProduct.jsp";from=(13,100);to=(13,129)]
/*使用shopManageSystemBean的實(shí)例*/
// end
// HTML // begin [file="/delProduct.jsp";from=(13,131);to=(18,0)]
out.write("\r\n<head>\r\n<title>刪除售出商品記錄</title>\r\n</head>\r\n<body>\r\n");
// end
// begin [file="/delProduct.jsp";from=(18,2);to=(32,0)]
int product_id = Integer.parseInt(new String(request.getParameter("delProductID").getBytes("8859_1"))); //獲取用戶指定刪除的庫(kù)存商品的ID號(hào)
boolean isExisted = shopManageBean.isProductExistedInOtherTable(product_id); //判斷賣出商品表和顧客交易表中是否存在涉及到此庫(kù)存商品的信息
if(isExisted) //若賣出商品表和顧客交易表中存在涉及到此庫(kù)存商品的信息,則不能刪除此庫(kù)存商品的信息
{
out.println("<h2 align=center>其它表中仍存在此商品的信息,請(qǐng)首先刪除其他表中此商品的信息</h2>");
out.println("<p align=center><a href=productSold.jsp>返回</a></p>");
}
else //若不存在,則刪除此庫(kù)存商品信息
{
shopManageBean.delProduct(product_id);
out.println("<h2 align=center>刪除售出商品記錄成功</h2>");
out.println("<p align=center><a href=productList.jsp>返回</a></p>");
}
// end
// HTML // begin [file="/delProduct.jsp";from=(32,2);to=(35,0)]
out.write("\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);
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -