zoukankan      html  css  js  c++  java
  • 校园商铺-9前端展示系统-10商品详情页的开发

    1.后端

    1.1 controller层

    package com.csj2018.o2o.web.frontend;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.ResponseBody;
    
    import com.csj2018.o2o.entity.Product;
    import com.csj2018.o2o.service.ProductService;
    import com.csj2018.o2o.util.HttpServletRequestUtil;
    
    @Controller
    @RequestMapping(value="/frontend")
    public class ProductDetailController {
    	@Autowired
    	private ProductService productService;
    	
    	@RequestMapping(value="/listproductdetailpageinfo",method=RequestMethod.GET)
    	@ResponseBody
    	private Map<String,Object> showProductDetail(HttpServletRequest request){
    		Map<String,Object> modelMap = new HashMap<String,Object>();
    		//获取前台传过来的productId
    		long productId = HttpServletRequestUtil.getLong(request, "productId");
    		Product product = null;
    		if(productId != -1) {
    			product = productService.getProductById(productId);
    			modelMap.put("product", product);
    			modelMap.put("success", true);
    		}else{
    			modelMap.put("success", false);
    			modelMap.put("errMsg", "empty productId");
    		}
    		return modelMap;
    	}
    }
    

    1.2验证

    2.前端

    2.1 html

    2.2js

    2.3验证

  • 相关阅读:
    Geoserver发布缓存切片(制定Gridsets)
    Oralce Spatial
    判断ArcSDE是否安装成功
    sqlserver操作geography方法
    ArcGIS Server 基于Token安全验证
    ArcGIS Server配置端口
    贝叶斯推断
    加密算法
    互联网协议认识
    yocto config mk.fs.ext4
  • 原文地址:https://www.cnblogs.com/csj2018/p/12628283.html
Copyright © 2011-2022 走看看