资源简介
网上商城SSH,使用mySql数据库。完整代码
代码片段和文件信息
package com.lyq.action;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;
import org.springframework.beans.factory.annotation.Autowired;
import com.lyq.dao.order.OrderDao;
import com.lyq.dao.product.ProductCategoryDao;
import com.lyq.dao.product.ProductDao;
import com.lyq.dao.product.UploadFileDao;
import com.lyq.dao.user.CustomerDao;
import com.lyq.dao.user.UserDao;
import com.lyq.model.order.OrderItem;
import com.lyq.model.user.Customer;
import com.lyq.model.user.User;
import com.opensymphony.xwork2.ActionSupport;
/**
* 基本Action对象,其它Action的父类
* @author Li Yongqiang
*/
public class baseAction extends ActionSupport implements RequestAware
SessionAware ApplicationAware {
private static final long serialVersionUID = 1L;
protected Integer id;
protected Integer[] ids;
protected int pageNo = 1;
protected int pageSize = 3;
public static final String LIST = “list“;
public static final String EDIT = “edit“;
public static final String ADD = “add“;
public static final String SELECT = “select“;
public static final String QUERY = “query“;
public static final String LEFT = “left“;
public static final String RIGHT = “right“;
public static final String INDEX = “index“;
public static final String MAIN = “main“;
public static final String MANAGER = “manager“;
public static final String TOP = “top“;
public static final String REG = “reg“;
public static final String USER_LOGIN = “userLogin“;
public static final String CUSTOMER_LOGIN = “customerLogin“;
public static final String LOGOUT = “logout“;
// 获取用户id
// 获取用户对象
public Customer getLoginCustomer(){
if(session.get(“customer“) != null){
return (Customer) session.get(“customer“);
}
return null;
}
// 获取管理员id
// 获取管理员对象
public User getLoginUser(){
if(session.get(“admin“) != null){
return (User) session.get(“admin“);
}
return null;
}
// 从session中取出购物车
@SuppressWarnings(“unchecked“)
protected Set getCart(){
object obj = session.get(“cart“);
if(obj == null){
return new HashSet();
}else{
return (Set) obj;
}
}
// 注入Dao
@Autowired
protected ProductCategoryDao categoryDao;
@Autowired
protected ProductDao productDao;
@Autowired
protected OrderDao orderDao;
@Autowired
protected UserDao userDao;
@Autowired
protected CustomerDao customerDao;
@Autowired
protected UploadFileDao uploadFileDao;
// Map类型的request
protected Mapject> request;
// Map类型的session
protected Mapject> session;
// Map类型的application
protected Mapject> application;
@Override
public void setRequest(Mapject> request) {
// 获取Map类型的request赋值
this.request = request;
}
@Override
public void setApplication
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-01-21 08:48 05\
目录 0 2013-01-21 08:48 05\Shop\
文件 3752 2011-05-23 16:03 05\Shop\.classpath
目录 0 2014-02-24 21:47 05\Shop\.myeclipse\
文件 285 2011-05-23 16:03 05\Shop\.myme
文件 1410 2011-05-23 16:03 05\Shop\.project
目录 0 2013-01-21 08:48 05\Shop\.settings\
文件 500 2011-05-23 16:03 05\Shop\.settings\.jsdtscope
文件 49 2011-05-23 16:03 05\Shop\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2011-05-23 16:03 05\Shop\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2013-01-21 08:48 05\Shop\WebRoot\
目录 0 2013-01-21 08:48 05\Shop\WebRoot\me
文件 39 2011-05-24 10:58 05\Shop\WebRoot\me
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\
文件 1662 2011-05-24 10:57 05\Shop\WebRoot\WEB-INF\classes\applicationContext-common.xm
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\lyq\
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\
文件 899 2011-05-24 10:57 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\ba
文件 4635 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\ba
文件 2802 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\IndexAction.class
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\interceptor\
文件 1341 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\interceptor\CustomerLoginInteceptor.class
文件 1325 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\interceptor\UserLoginInterceptor.class
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\order\
文件 3103 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\order\CartAction.class
文件 1314 2011-05-24 11:41 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\order\OrderAction-order_confirm-validation.xm
文件 6861 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\order\OrderAction.class
目录 0 2013-01-21 08:48 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\product\
文件 11849 2011-05-24 10:58 05\Shop\WebRoot\WEB-INF\classes\com\lyq\action\product\ProductAction.class
............此处省略334个文件信息
评论
共有 条评论