资源简介

网上书店 JavaEE课程期末大型试验 SSH架构 MySQL数据库 期末试验参考或改编必备精品

资源截图

代码片段和文件信息

package cn.itcast.action;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.opensymphony.xwork2.ActionContext;

import cn.itcast.bean.Oders;
import cn.itcast.service.OdersService;
import cn.itcast.bean.shopping;
import cn.itcast.service.shoppingService;
import cn.itcast.bean.Book;
import cn.itcast.service.BookService;
import cn.itcast.bean.User;
import cn.itcast.service.UserService;
@Controller @Scope(“prototype“)
public class adminAction {
@Resource shoppingService shoppingService;
@Resource OdersService odersService;
@Resource BookService bookService;
@Resource UserService userService;
private String count;
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}

private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

private String password;

public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}

public String login()
{
if(password.equals(“admin“)&&username.equals(“admin“))
{
ActionContext.getContext().put(“message“ “登录成功“);
return “success“;
}
ActionContext.getContext().put(“message“ “您没有权限“);
return “error“;
}
public String deliver()
{
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
List list=new ArrayList();
list=(List)session.getAttribute(“adminlist“);
if(list!=null)
{
int i=Integer.parseInt(count);
Oders oders1=new Oders();
String id=list.get(i).getId();
oders1=odersService.findbyid(id);

oders1.setStatus(“已发货“);
odersService.update(oders1);
ActionContext.getContext().put(“message“ “发货成功“);
return “deliver“;
}
ActionContext.getContext().put(“message“ “发货失败“);
return “message“;
}
public String list()
{
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();

/*Book book=(Book)session.getAttribute(“book“);
User user=(User)session.getAttribute(“loginUser“);
session.removeAttribute(“book“);
session.setAttribute(“book“ book);*/

List list=new  ArrayList();
list=odersService.list();

for(int i=0;i {
String isbn=list.get(i).getBook().getIsbn();
String id=list.get(i).getUser().getID();
Book book1=(Book)bookService.findbyid(isbn);
User user1=(User)userService.findbyid(id);
list.get(i).setBook(book1);
list.get(i).setUser(user1);
}
//ActionConte

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

     文件        607  2013-12-22 00:40  bookstore-SSH\bookstore\.classpath

     文件        300  2013-12-22 00:39  bookstore-SSH\bookstore\.mymetadata

     文件       1752  2013-12-22 00:29  bookstore-SSH\bookstore\.project

     文件        500  2013-12-22 00:16  bookstore-SSH\bookstore\.settings\.jsdtscope

     文件        139  2013-12-29 02:17  bookstore-SSH\bookstore\.settings\org.eclipse.core.resources.prefs

     文件        395  2013-12-22 00:16  bookstore-SSH\bookstore\.settings\org.eclipse.jdt.core.prefs

     文件        465  2013-12-22 00:39  bookstore-SSH\bookstore\.settings\org.eclipse.wst.common.component

     文件        252  2013-12-22 00:39  bookstore-SSH\bookstore\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2013-12-22 00:39  bookstore-SSH\bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2013-12-22 00:39  bookstore-SSH\bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3140  2013-12-31 19:00  bookstore-SSH\bookstore\src\beans.xml

     文件       3175  2014-01-01 02:17  bookstore-SSH\bookstore\src\cn\itcast\action\adminAction.java

     文件       1776  2013-12-30 15:19  bookstore-SSH\bookstore\src\cn\itcast\action\BookManageAction.java

     文件        453  2013-12-22 00:17  bookstore-SSH\bookstore\src\cn\itcast\action\EmployeeAction.java

     文件        783  2013-12-22 00:17  bookstore-SSH\bookstore\src\cn\itcast\action\EmployeeManageAction.java

     文件       4529  2014-01-01 02:13  bookstore-SSH\bookstore\src\cn\itcast\action\OdersManageAction.java

     文件       5106  2013-12-31 22:22  bookstore-SSH\bookstore\src\cn\itcast\action\shoppingManageAction.java

     文件       1683  2013-12-29 23:29  bookstore-SSH\bookstore\src\cn\itcast\action\UserManageAction.java

     文件        603  2013-12-29 01:57  bookstore-SSH\bookstore\src\cn\itcast\bean\Book.hbm.xml

     文件        777  2013-12-29 01:50  bookstore-SSH\bookstore\src\cn\itcast\bean\Book.java

     文件        842  2013-12-22 00:17  bookstore-SSH\bookstore\src\cn\itcast\bean\Employee.hbm.xml

     文件        681  2013-12-22 00:17  bookstore-SSH\bookstore\src\cn\itcast\bean\Employee.java

     文件         85  2013-12-22 00:17  bookstore-SSH\bookstore\src\cn\itcast\bean\Gender.java

     文件        597  2013-12-31 18:29  bookstore-SSH\bookstore\src\cn\itcast\bean\Oders.hbm.xml

     文件       1163  2014-01-01 01:53  bookstore-SSH\bookstore\src\cn\itcast\bean\Oders.java

     文件        493  2013-12-29 22:46  bookstore-SSH\bookstore\src\cn\itcast\bean\shopping.hbm.xml

     文件        803  2013-12-29 15:53  bookstore-SSH\bookstore\src\cn\itcast\bean\shopping.java

     文件        890  2013-12-28 05:18  bookstore-SSH\bookstore\src\cn\itcast\bean\User.hbm.xml

     文件        785  2013-12-28 04:02  bookstore-SSH\bookstore\src\cn\itcast\bean\User.java

     文件        373  2013-12-30 14:08  bookstore-SSH\bookstore\src\cn\itcast\service\BookService.java

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

评论

共有 条评论