首页>代码>SSM网上购物商城系统>/shop/src/com/shop/controller/CategorySecondController.java
package com.shop.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.shop.Utils.PageBean;
import com.shop.po.Product;
import com.shop.service.ProductService;

@Controller
public class CategorySecondController {
	@Autowired
	private ProductService productService;
//根据一级目录查找二级目录下面的商品(使用延迟加载但是这里不知为啥使用起来出错了)
	@RequestMapping("/findCategorySecond")
	public String findCategorySecond(HttpServletRequest request,@RequestParam int cid,Model model,@RequestParam int page) throws Exception {
		request.getSession().setAttribute("cid",cid);
		PageBean<Product> proPageBean = productService.findProductyBycid(cid,page);
		model.addAttribute("pageBean",proPageBean);
		return "category";
	}
	
//	根据csid来分页查询商品
	@RequestMapping("/findCategorySecond1")
	public String findCategorySecond1(@RequestParam int csid,Model model,@RequestParam int page){
		PageBean<Product> proPageBean = productService.finbProductByCsid(csid,page);
		model.addAttribute("pageBean",proPageBean);
		return "category";
	}
}
最近下载更多
zuidaama  LV2 4月12日
微信网友_7041036943331328  LV7 2024年12月15日
txf123  LV6 2024年12月10日
zolscy  LV24 2024年11月28日
lyt010628  LV4 2024年7月9日
3038169233  LV1 2024年7月5日
TY0165  LV20 2024年6月25日
樱花味小然子  LV5 2024年6月21日
lilitu  LV6 2024年5月30日
微信网友_7000012089643008  LV4 2024年5月20日
最近浏览更多
tomsrt 昨天
暂无贡献等级
1111111lll 4月24日
暂无贡献等级
dyhyhgh 4月22日
暂无贡献等级
412685265123 4月12日
暂无贡献等级
zuidaama  LV2 4月11日
2022102154  LV1 3月27日
orang801  LV2 2月20日
ryadmin123  LV2 2月6日
ma406805131  LV19 1月2日
刘正风 2024年12月24日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友