• 大小: 395KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: Java
  • 标签: java  mysql  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  2008-10-06 08:57  02\banner.jsp

     文件       3572  2008-10-06 08:57  02\book.jsp

     文件       7260  2008-10-06 08:57  02\bookBack.jsp

     文件        136  2008-10-06 08:57  02\bookBack_ok.jsp

     文件       8124  2008-10-06 08:57  02\bookBorrow.jsp

     文件       3310  2008-10-06 08:57  02\bookBorrowSort.jsp

     文件        138  2008-10-06 08:57  02\bookBorrow_ok.jsp

     文件       2941  2008-10-06 08:57  02\bookcase.jsp

     文件       1757  2008-10-06 08:57  02\bookcase_add.jsp

     文件       1859  2008-10-06 08:57  02\bookCase_Modify.jsp

     文件        876  2008-10-06 08:57  02\bookcase_ok.jsp

     文件       3815  2008-10-06 08:57  02\bookQuery.jsp

     文件       7232  2008-10-06 08:57  02\bookRenew.jsp

     文件        137  2008-10-06 08:57  02\bookRenew_ok.jsp

     文件       3121  2008-10-06 08:57  02\bookType.jsp

     文件       2162  2008-10-06 08:57  02\bookType_add.jsp

     文件       2185  2008-10-06 08:57  02\bookType_Modify.jsp

     文件        819  2008-10-06 08:57  02\bookType_ok.jsp

     文件       5873  2008-10-06 08:57  02\book_add.jsp

     文件       4480  2008-10-06 08:57  02\book_detail.jsp

     文件       7026  2008-10-06 08:57  02\book_Modify.jsp

     文件        807  2008-10-06 08:57  02\book_ok.jsp

     文件       5536  2008-10-06 08:57  02\borrowQuery.jsp

     文件       2992  2008-10-06 08:57  02\bremind.jsp

     文件        780  2008-10-06 08:57  02\copyright.jsp

     文件       1118  2008-10-06 08:57  02\error.jsp

     文件       4286  2008-10-06 08:57  02\library_modify.jsp

     文件        381  2008-10-06 08:57  02\library_ok.jsp

     文件       4105  2008-10-06 08:57  02\login.jsp

     文件        348  2008-10-06 08:57  02\login_false.jsp

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

评论

共有 条评论