资源简介

my eclipse开发的J2EE图书馆管理系统

资源截图

代码片段和文件信息

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

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

     文件        507  2013-05-14 16:32  JavaPrj_16\.classpath

     文件        304  2013-05-14 16:32  JavaPrj_16\.mymetadata

     文件       1753  2013-05-14 16:32  JavaPrj_16\.project

     文件        500  2013-05-14 16:32  JavaPrj_16\.settings\.jsdtscope

     文件       1040  2013-05-14 16:32  JavaPrj_16\.settings\com.genuitec.eclipse.j2eedt.core.prefs

     文件        268  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.core.resources.prefs

     文件        303  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.jdt.core.prefs

     文件        468  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.wst.common.component

     文件        252  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2013-05-14 16:32  JavaPrj_16\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       9829  2013-05-14 16:35  JavaPrj_16\db_library.sql

     文件       7773  2013-05-14 16:32  JavaPrj_16\src\com\action\Book.java

     文件       4810  2013-05-14 16:32  JavaPrj_16\src\com\action\BookCase.java

     文件       5271  2013-05-14 16:32  JavaPrj_16\src\com\action\BookType.java

     文件       9218  2013-05-14 16:32  JavaPrj_16\src\com\action\Borrow.java

     文件       2586  2013-05-14 16:32  JavaPrj_16\src\com\action\Library.java

     文件       7196  2013-05-14 16:32  JavaPrj_16\src\com\action\Manager.java

     文件       2296  2013-05-14 16:32  JavaPrj_16\src\com\action\Parameter.java

     文件       1650  2013-05-14 16:32  JavaPrj_16\src\com\action\Publishing.java

     文件       7015  2013-05-14 16:32  JavaPrj_16\src\com\action\Reader.java

     文件       5302  2013-05-14 16:32  JavaPrj_16\src\com\action\ReaderType.java

     文件        493  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\BookCaseForm.java

     文件       3219  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\BookForm.java

     文件        627  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\BookTypeForm.java

     文件       4354  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\BorrowForm.java

     文件       1784  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\LibraryForm.java

     文件       1633  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\ManagerForm.java

     文件        651  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\ParameterForm.java

     文件        979  2013-05-14 16:32  JavaPrj_16\src\com\actionForm\PublishingForm.java

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

评论

共有 条评论