BookCaseDel.java~7~
上传用户:toby828
上传日期:2015-06-26
资源大小:8558k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. package com.action;
  2. import org.apache.struts.action.ActionMapping;
  3. import org.apache.struts.action.ActionForm;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.apache.struts.action.ActionForward;
  7. import com.actionForm.BookCaseForm;
  8. import org.apache.struts.action.Action;
  9. import com.dao.BookCaseDAO;
  10. public class BookCaseDel extends Action {
  11.     BookCaseDAO bookCaseDAO=new BookCaseDAO();
  12.     public ActionForward perform(ActionMapping actionMapping,
  13.                                  ActionForm actionForm,
  14.                                  HttpServletRequest servletRequest,
  15.                                  HttpServletResponse servletResponse) {
  16.         BookCaseForm bookCaseForm = (BookCaseForm) actionForm;
  17.         bookCaseForm.setId(Integer.valueOf(servletRequest.getParameter("ID")));
  18.         int ret=bookCaseDAO.Delete(bookCaseForm);
  19.         if(ret==0){
  20.             return actionMapping.findForward("error");
  21.         }else{
  22.             return actionMapping.findForward("bookCaseDel");
  23.         }
  24.     }
  25. }