资源简介

第一个做的比较完整的基于Spring+Springmvc+mybaties的作品,算不上项目。就为了积分,给大家参考吧。

资源截图

代码片段和文件信息

package org.example.shop.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.example.shop.service.GoodService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller(“goodController“)

public class GoodController {
private GoodService goodService;


public GoodService getGoodService() {
return goodService;
}

@Resource(name=“goodService“)
public void setGoodService(GoodService goodService) {
this.goodService = goodService;
}

/**
 * 用户购买物品的controller
 * @param request
 * @param serial
 * @param type
 * @return
 * @throws Exception
 */
@RequestMapping(“/buy“)
public String showAllGoods(HttpServletRequest request@RequestParam(“goodsserial“) String goodsserial@RequestParam(“userserial“) String userserial) throws Exception{

return goodService.addGoodsToUser(userserial goodsserial);
}

/**
 * 根据请求中的type参数,列出相应的货物
 * @param request
 * @param serial
 * @param type
 * @return
 */
@RequestMapping(“/showgoods“)
@ResponseBody
public String showGoodsByType(HttpServletRequest request@RequestParam(“type“) String type){
System.out.println(“type is :“+type);
goodService.findGoodsByType(request type);
return ““;
}

/**
 * 用户查询购物车
 * @param request
 * @param serial
 * @return
 */
@RequestMapping(“/check“)
@ResponseBody
public String checkGoodsByUser(HttpServletRequest request@RequestParam(“serial“) String serial){
goodService.findGoodsByUser(request serial);
return ““;
}

@RequestMapping(“/delete“)
public String deleteGoodsBuUser(HttpServletRequest request@RequestParam(“userserial“) String userserial
@RequestParam(“goodsserial“) String goodsserial){
goodService.deleteGoodsByUser(userserial goodsserial);
goodService.findGoodsByUser(request userserial);
return “redirect:jsp/main/mylist.jsp?serial=“+userserial;
}

}

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

     文件       2243  2014-12-17 14:38  Shop\.classpath

     文件        285  2014-12-17 13:50  Shop\.mymetadata

     文件       1747  2014-12-17 21:09  Shop\.project

     文件        500  2014-12-17 13:50  Shop\.settings\.jsdtscope

     文件        471  2014-12-26 18:32  Shop\.settings\org.eclipse.core.resources.prefs

     文件        395  2014-12-17 13:50  Shop\.settings\org.eclipse.jdt.core.prefs

     文件        450  2014-12-17 13:50  Shop\.settings\org.eclipse.wst.common.component

     文件        206  2014-12-17 13:50  Shop\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2014-12-17 13:50  Shop\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2014-12-17 13:50  Shop\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件        109  2014-12-17 21:48  Shop\src\db.properties

     文件       1516  2014-12-26 18:20  Shop\src\goods-mapping.xml

     文件        757  2014-12-25 09:16  Shop\src\mybatis-config.xml

     文件       2173  2014-12-26 18:27  Shop\src\org\example\shop\controller\GoodController.java

     文件       1999  2014-12-25 14:37  Shop\src\org\example\shop\controller\UserController.java

     文件        544  2014-12-26 18:21  Shop\src\org\example\shop\dao\IGoodDao.java

     文件       2711  2014-12-26 18:23  Shop\src\org\example\shop\dao\impl\GoodDao.java

     文件       1663  2014-12-24 12:43  Shop\src\org\example\shop\dao\impl\UserDao.java

     文件        301  2014-12-24 12:44  Shop\src\org\example\shop\dao\IUserDao.java

     文件       1240  2014-12-25 19:23  Shop\src\org\example\shop\filter\LoginFilter.java

     文件       1229  2014-12-25 21:55  Shop\src\org\example\shop\filter\MainFilter.java

     文件         65  2014-12-17 21:52  Shop\src\org\example\shop\mapper\add.java

     文件         83  2014-12-17 21:27  Shop\src\org\example\shop\pojo\Address.java

     文件       1715  2014-12-25 13:48  Shop\src\org\example\shop\pojo\Goods.java

     文件        500  2014-12-26 11:10  Shop\src\org\example\shop\pojo\OrderList.java

     文件       1270  2014-12-24 10:22  Shop\src\org\example\shop\pojo\User.java

     文件       2183  2014-12-26 18:36  Shop\src\org\example\shop\service\GoodService.java

     文件       5381  2014-12-25 19:27  Shop\src\org\example\shop\service\UserService.java

     文件        809  2014-12-17 21:21  Shop\src\org\example\shop\util\DBUtil.java

     文件       1122  2014-12-22 20:24  Shop\src\org\example\shop\util\SafeCode.java

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

评论

共有 条评论