前端date类型的数据,后端如何接收

 时间:2026-02-15 06:33:54

1、   @RequestMapping(value = "/add",method = RequestMethod.POST)

    @ResponseBody

    public Map<String,Object> add(Product product){   

    Map<String,Object> maps = new HashMap<String,Object>();   

    try {

    productService.save(product);

    

前端date类型的数据,后端如何接收

2、maps.put("message", "100");

} catch (Exception e) {

// TODO: handle exception

}

        return maps;

    }

后端实体对象直接

前端date类型的数据,后端如何接收

3、  @InitBinder

public void initBinder(WebDataBinder binder){

DateFormat format = new SimpleDateFormat("yyyy-MM-dd");

binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true));

}

后端必须配置,springmvc 默认不会自动转换date

前端date类型的数据,后端如何接收

4、<div style="margin-top: 10px;">

<div class="col-xs-6 col-md-4" style="border-right: 2px solid #eee;">

政府认证

</div>

<div class="col-xs-6 col-md-4" style="border-right: 2px solid #eee;">

质量保证

</div>

<div class="col-xs-6 col-md-4">

公司担保

</div>

</div>

前端date类型的数据,后端如何接收

5、<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">

<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>

<span class="sr-only">Previous</span>

</a>

前端date类型的数据,后端如何接收

6、<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">

<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>

<span class="sr-only">Next</span>

</a>

前端date类型的数据,后端如何接收

7、@RequestMapping(value = "/delete",method = RequestMethod.POST)

    @ResponseBody

    public Map<String,Object> delete(

            @RequestParam("ids[]") List<Long> ids){

        Map<String,Object> result = new HashMap<>();

        try{

        for(Long i:ids){

        productService.delete(i);

        }          

            result.put("success",true);

        }catch (RuntimeException e){

            e.printStackTrace();

            result.put("success",false);

            result.put("errorInfo",e.getMessage());

        }

        return result;

    }

前端date类型的数据,后端如何接收

  • 交女朋友的五大神器
  • 夏天去海边游玩,要做好哪些防晒工作?
  • 天天炫斗不能在新区创建角色怎么办
  • 怎么做豉油藤椒蒸桂鱼
  • 如何照顾感冒的孩子
  • 热门搜索
    如何消除法令纹 qq说说怎么全部删除 长白山旅游股份有限公司 如何制作泡菜 如何和面 旅游发朋友圈的精美句子 楷模家具怎么样 研究生培养方式怎么填 太原工业学院怎么样 怎么重置无线路由器