• 大小: 3.25MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-12
  • 语言: 数据库
  • 标签: Struts  

资源简介

本系统中包含6个功能模块:系统设置,读者管理,图书管理,图书借还,系统查询和更改口令。亲测可用

资源截图

代码片段和文件信息

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){

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

     文件       8826  2018-01-15 15:06  books\database\bbsdata\article.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\article.ibd

     文件         61  2018-01-15 15:05  books\database\bbsdata\db.opt

     文件       8686  2018-01-15 15:06  books\database\bbsdata\friends.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\friends.ibd

     文件       8716  2018-01-15 15:06  books\database\bbsdata\images.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\images.ibd

     文件       8666  2018-01-15 15:06  books\database\bbsdata\liuyan.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\liuyan.ibd

     文件       8710  2018-01-15 15:06  books\database\bbsdata\message.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\message.ibd

     文件       8714  2018-01-15 15:06  books\database\bbsdata\re_article.frm

     文件      98304  2018-01-15 15:06  books\database\bbsdata\re_article.ibd

     文件       9012  2018-01-15 15:06  books\database\bbsdata\user.frm

     文件      65536  2018-01-15 15:14  books\database\bbsdata\user.ibd

     文件        836  2018-01-15 15:25  books\LibraryManage\.classpath

     文件        913  2018-01-15 15:25  books\LibraryManage\.project

     文件        567  2018-01-15 15:25  books\LibraryManage\.settings\.jsdtscope

     文件         55  2018-01-15 15:36  books\LibraryManage\.settings\org.eclipse.core.resources.prefs

     文件        364  2018-01-15 15:25  books\LibraryManage\.settings\org.eclipse.jdt.core.prefs

     文件        491  2018-01-15 15:25  books\LibraryManage\.settings\org.eclipse.wst.common.component

     文件        345  2018-01-15 15:25  books\LibraryManage\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-01-15 15:25  books\LibraryManage\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-01-15 15:25  books\LibraryManage\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       5628  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\Book.class

     文件       3890  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\BookCase.class

     文件       3978  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\BookType.class

     文件       6222  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\Borrow.class

     文件       2823  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\Library.class

     文件       5765  2018-01-15 15:36  books\LibraryManage\build\classes\com\action\Manager.class

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

评论

共有 条评论