首页>代码>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";
	}
}
最近下载更多
gdt234  LV3 4月22日
wzy100007 4月6日
暂无贡献等级
xiongM  LV4 4月1日
坚持者  LV3 3月14日
刘自盛  LV2 3月1日
wbw123  LV5 3月1日
eam124  LV2 2月20日
ljfydm  LV2 1月28日
2429449458  LV2 1月25日
duoduo1234  LV2 1月19日
最近浏览更多
gdt234  LV3 4月22日
ruozizz  LV2 4月20日
fdeded  LV1 4月20日
xiexin  LV1 4月13日
mzqnxyh  LV2 4月12日
ztteqffefqw 4月11日
暂无贡献等级
120000000 4月8日
暂无贡献等级
xiongM  LV4 4月1日
wangsheng818  LV4 4月1日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友