• 大小: 407KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Java
  • 标签: JSP  

资源简介

图书管理系统图书管理系统图书管理系统图书管理系统图书管理系统图书管理系统

资源截图

代码片段和文件信息

package com.action;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import com.actionForm.BookForm;
import org.apache.struts.action.Action;
import com.dao.BookDAO;
import java.util.Date;

public class Book extends Action {
    private BookDAO bookDAO = null;
    public Book() {
        this.bookDAO = new BookDAO();
    }

    public ActionForward execute(ActionMapping mapping ActionForm form
                                 HttpServletRequest request
                                 HttpServletResponse response) {
        String action =request.getParameter(“action“);
        System.out.println(“\nbook*********************action=“+action);
        if(action==null||““.equals(action)){
            request.setAttribute(“error““您的操作有误!“);
            return mapping.findForward(“error“);
        }else if(“bookAdd“.equals(action)){
            return bookAdd(mappingformrequestresponse);
        }else if(“bookQuery“.equals(action)){
            return bookQuery(mappingformrequestresponse);
        }else if(“bookModifyQuery“.equals(action)){
            return bookModifyQuery(mappingformrequestresponse);
        }else if(“bookModify“.equals(action)){
            return bookModify(mappingformrequestresponse);
        }else if(“bookDel“.equals(action)){
            return bookDel(mappingformrequestresponse);
        }else if(“bookDetail“.equals(action)){
            return bookDetail(mappingformrequestresponse);
        }else if(“bookifQuery“.equals(action)){
            return bookifQuery(mappingformrequestresponse);
        }
        request.setAttribute(“error““操作失败!“);
        return mapping.findForward(“error“);
    }
    /***********************添加图书信息**************************/
    private ActionForward bookAdd(ActionMapping mapping ActionForm form
                              HttpServletRequest request
                              HttpServletResponse response){
           BookForm bookForm = (BookForm) form;
           bookForm.setBarcode(bookForm.getBarcode());
           bookForm.setBookName(bookForm.getBookName());
           bookForm.setTypeId(bookForm.getTypeId());
           bookForm.setAuthor(bookForm.getAuthor());
           bookForm.setTranslator(bookForm.getTranslator());
           bookForm.setIsbn(bookForm.getIsbn());
           bookForm.setPrice(bookForm.getPrice());
           bookForm.setPage(bookForm.getPage());
           bookForm.setBookcaseid(bookForm.getBookcaseid());    
           //获取系统日期
           Date date1=new Date();
           java.sql.Date date=new java.sql.Date(date1.getTime());
           bookForm.setInTime(date.toString());
           bookForm.setOperator(bookForm.getOperator());
           int a=bookDAO.insert(bookForm);
           if(a==1){

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1385  2007-12-18 15:38  02\banner.jsp

     文件       3572  2007-12-19 09:02  02\book.jsp

     文件       7260  2007-12-18 15:38  02\bookBack.jsp

     文件        136  2007-12-18 15:38  02\bookBack_ok.jsp

     文件       8124  2007-12-18 15:38  02\bookBorrow.jsp

     文件       3310  2007-12-18 15:38  02\bookBorrowSort.jsp

     文件        138  2007-12-18 15:38  02\bookBorrow_ok.jsp

     文件       2941  2007-12-18 15:38  02\bookcase.jsp

     文件       1757  2007-12-18 15:38  02\bookcase_add.jsp

     文件       1859  2007-12-18 15:38  02\bookCase_Modify.jsp

     文件        876  2007-12-18 15:38  02\bookcase_ok.jsp

     文件       3815  2007-01-08 19:35  02\bookQuery.jsp

     文件       7232  2007-12-18 15:38  02\bookRenew.jsp

     文件        137  2007-12-18 15:38  02\bookRenew_ok.jsp

     文件       3121  2007-12-18 15:38  02\bookType.jsp

     文件       2162  2007-12-18 15:38  02\bookType_add.jsp

     文件       2185  2007-12-18 15:38  02\bookType_Modify.jsp

     文件        819  2007-12-18 15:38  02\bookType_ok.jsp

     文件       5873  2007-12-18 15:51  02\book_add.jsp

     文件       4480  2007-12-18 15:46  02\book_detail.jsp

     文件       7026  2007-12-18 15:46  02\book_Modify.jsp

     文件        807  2007-12-18 15:38  02\book_ok.jsp

     文件       5536  2007-12-18 15:38  02\borrowQuery.jsp

     文件       2992  2007-12-18 15:38  02\bremind.jsp

     文件        780  2007-12-18 15:38  02\copyright.jsp

     文件       3068  2007-12-18 15:38  02\CSS\style.css

     文件         65  2007-11-21 13:56  02\Database\db_librarySys\db.opt

     文件       8624  2007-11-21 13:59  02\Database\db_librarySys\tb_bookcase.frm

     文件         40  2007-12-29 13:29  02\Database\db_librarySys\tb_bookcase.MYD

     文件       2048  2007-12-29 13:29  02\Database\db_librarySys\tb_bookcase.MYI

............此处省略187个文件信息

评论

共有 条评论