资源简介
图书馆管理系统由读者管理、图书管理、借阅、归还、续借、系统查询、排行榜、系统设置等管理模块组成
代码片段和文件信息
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 perform(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());
bookForm.setStorage(bookForm.getStorage());
//获取系统日期
Date date1=new Date();
java.sql.Date date=new java.sql.Date(date1.getTime());
bookForm.setInTime(date.toString());
bookForm.setOperator(bookForm.getOperator());
in
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-09-04 11:23 Library\
文件 583 2008-04-21 10:10 Library\.classpath
目录 0 2009-09-04 11:23 Library\.myeclipse\
文件 294 2008-05-11 11:46 Library\.myme
文件 1225 2008-04-19 09:58 Library\.project
目录 0 2009-09-04 11:23 Library\Databa
目录 0 2009-09-04 11:23 Library\Databa
文件 65 2007-01-15 11:16 Library\Databa
文件 8586 2007-01-15 11:16 Library\Databa
文件 384 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 9006 2007-01-15 11:16 Library\Databa
文件 592 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8624 2007-01-15 11:16 Library\Databa
文件 116 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8780 2007-01-15 11:16 Library\Databa
文件 380 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8704 2007-01-15 11:16 Library\Databa
文件 28 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8842 2007-01-15 11:16 Library\Databa
文件 116 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8614 2007-01-15 11:16 Library\Databa
文件 140 2007-01-15 11:16 Library\Databa
文件 2048 2007-01-15 11:16 Library\Databa
文件 8624 2007-01-15 11:16 Library\Databa
文件 13 2007-01-15 11:16 Library\Databa
............此处省略182个文件信息
评论
共有 条评论