• 大小: 24.25MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-02
  • 语言: Java
  • 标签: java  网上购物  

资源简介

本系统是基于java的网上购物系统,压缩包中包含源码(java和sql(My SQL)文件),论文和ppt;主要功能有 分类管理 商品管理 注册用户管理 网站公告管理 订单管理 用户的功能主要有: 注册登录功能 商品浏览功能,包括分类浏览,推荐浏览,搜索浏览,排行榜浏览 公告浏览 购物车管理 订单管理

资源截图

代码片段和文件信息

package gouwushangcheng.action;

import gouwushangcheng.dao.DingdanDao;
import gouwushangcheng.dao.FenleiDao;
import gouwushangcheng.dao.GonggaoDao;
import gouwushangcheng.dao.GouwucheDao;
import gouwushangcheng.dao.ProductDao;
import gouwushangcheng.dao.UserDao;
import gouwushangcheng.model.Dingdan;
import gouwushangcheng.model.Gonggao;
import gouwushangcheng.model.Gouwuche;
import gouwushangcheng.model.Product;
import gouwushangcheng.model.User;

import gouwushangcheng.util.Pager;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class IndexAction extends ActionSupport {
 
private static final long serialVersionUID = 1L;

private String url = “./“;

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

//首页
public  String  index(){
HttpServletRequest request = ServletActionContext.getRequest();
List list1 = productDao.selectBeanList(0 3 “ where deletestatus=0 order by id desc “);//新品推荐
request.setAttribute(“productlist1“ list1);
List list2 = productDao.selectBeanList(0 3 “ where deletestatus=0 and tuijian=‘推荐‘ order by id desc “);//店长推荐
request.setAttribute(“productlist2“ list2);
return “success“;

}
/**
 * 将userDao注入到IndexAction当中
 */
    private UserDao userDao;

public UserDao getUserDao() {
return userDao;
}

public void setUserDao(UserDao userDao) {
this.userDao = userDao;
}

// 用户注册操作
public void register() throws IOException {
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
String username = request.getParameter(“username“);
String address = request.getParameter(“address“);
String email = request.getParameter(“email“);
String password = request.getParameter(“password“);
String phone = request.getParameter(“phone“);
String qq = request.getParameter(“qq“);
String truename = request.getParameter(“truename“);

User bean = userDao.selectBean(“  where deletestatus=0 and username=‘“
+ username + “‘“);

if (bean == null) {
bean = new User();
bean.setAddress(address);
bean.setCreatetime(new Date());
bean.setEmail(email);
bean.setPassword(password);
bean.setPhone(phone);
bean.setQq(qq);
bean.setTruename(truename);
bean.setUsername(username);
userDao.insertBean(bean);
response.setCharacterEncoding(“utf-8“);response.setContentType(“text/html; charset=utf-8“);
PrintWriter writer = response.getWriter();
writer
.print(“ript  language=‘javascript‘>alert(‘注册成功‘);window.location.href=‘index‘; ript>“);
} else {
r

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-06-02 09:33  网上购物\
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\
     文件        5275  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\.classpath
     目录           0  2014-01-16 15:26  网上购物\cp174mysql版源代码\cp174\.myeclipse\
     文件         288  2014-01-16 14:58  网上购物\cp174mysql版源代码\cp174\.mymetadata
     文件        1223  2014-01-07 16:39  网上购物\cp174mysql版源代码\cp174\.project
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\action\
     文件       19769  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\action\IndexAction.java
     文件       26417  2014-01-16 14:57  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\action\ManageAction.java
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\
     文件         700  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\DingdanDao.java
     文件         693  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\FenleiDao.java
     文件         704  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\GonggaoDao.java
     文件         707  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\GouwucheDao.java
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\
     文件        1670  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\DingdanDaoImpl.java
     文件        1655  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\FenleiDaoImpl.java
     文件        1670  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\GonggaoDaoImpl.java
     文件        1685  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\GouwucheDaoImpl.java
     文件        1655  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\ManageDaoImpl.java
     文件        1670  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\ProductDaoImpl.java
     文件        1625  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\impl\UserDaoImpl.java
     文件         693  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\ManageDao.java
     文件         700  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\ProductDao.java
     文件         679  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\dao\UserDao.java
     目录           0  2014-05-19 14:39  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\model\
     文件        2557  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\model\Dingdan.java
     文件         807  2014-01-07 16:37  网上购物\cp174mysql版源代码\cp174\src\gouwushangcheng\model\Fenlei.java
............此处省略272个文件信息

评论

共有 条评论