• 大小: 20.8MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-27
  • 语言: Java
  • 标签: Javaweb  mysql  

资源简介

用javaweb完成了二手书籍交易系统,数据库用的mysql。

资源截图

代码片段和文件信息

package com.action;

import java.util.ArrayList;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.model.Book;
import com.model.User;
import com.opensymphony.xwork2.ActionContext;
import com.service.BookServiceImpl;

@Service@Transactional
@Controller@Scope(“prototype“)
public class BookAction{
String keyName;

public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@Resource BookServiceImpl bookService;
private Book book;

public Book getBook() {
return book;
}
public void setBook(Book book) {
this.book = book;
}
private ArrayList bookList;

public ArrayList getBookList() {
return bookList;
}
public void setBookList(ArrayList bookList) {
this.bookList = bookList;
}
ActionContext actionContext=ActionContext.getContext();
Map session=actionContext.getSession();
    //书籍的上架
@SuppressWarnings(“unchecked“)
public String bRegister() throws Exception{
/*String ownerName=((User)session.get(“user“)).getUsername();
book.setOwner(ownerName);*/
bookService.register(book);
session.put(“book“ book);
return “su_reg“;
}
//owner登陆后,书籍上架时辅助传owner的值
public String register(){
return “book_register“;
}
//显示我的图书列表
@SuppressWarnings(“unchecked“)
public String showMyBook(){
//String ownerName=((User)session.get(“user“)).getUsername();
bookList=bookService.showMyBooks(book.getOwner());
//session.put(“list“ bookList);
return “show_MyBook“;
}
//显示书籍详细信息
public String showBookInfo(){
        book=bookService.showBookInfo(book.getId());
return “show_bookInfo“;
}
//显示要修改的书籍信息
public String showBookEdit(){
book=bookService.showBookInfo(book.getId());
return “show_edit“;
}
//修改书籍详细信息
public String updateBook(){
bookService.update(book);
return “show_bookInfo“;
}
//书籍的下架(删除)
@SuppressWarnings(“unused“)
public String deleteBook(){
User user=(User)session.get(“user“);
book=bookService.getBookById(book.getId());
bookService.delete(book);
return “delete_book“;
}
/*查询book*/
    public String queryBooks() throws Exception {
     bookList = bookService.queryBooks(keyName);
     System.out.println(keyName);
        return “index“;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-04-07 19:00  Bshop-master\
     文件        3760  2016-04-07 19:00  Bshop-master\.classpath
     文件         517  2016-04-07 19:00  Bshop-master\.myhibernatedata
     文件         281  2016-04-07 19:00  Bshop-master\.mymetadata
     文件        1886  2016-04-07 19:00  Bshop-master\.project
     目录           0  2016-04-07 19:00  Bshop-master\.settings\
     文件         488  2016-04-07 19:00  Bshop-master\.settings\.jsdtscope
     文件         187  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.core.resources.prefs
     文件         357  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.jdt.core.prefs
     文件         444  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.wst.common.component
     文件         245  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-04-07 19:00  Bshop-master\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\meta-INF\
     文件          36  2016-04-07 19:00  Bshop-master\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\
     文件        4376  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\applicationContext.xml
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\action\
     文件        3534  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\action\BookAction.class
     文件        3657  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\action\OrderAction.class
     文件        2959  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\action\UserAction.class
     目录           0  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\
     文件        3264  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\BookDao.class
     文件         545  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\IBook.class
     文件         574  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\IOrder.class
     文件         515  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\IUser.class
     文件        3356  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\OrderDao.class
     文件        2796  2016-04-07 19:00  Bshop-master\WebRoot\WEB-INF\classes\com\dao\UserDao.class
............此处省略156个文件信息

评论

共有 条评论