前端date类型的数据,后端如何接收
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);

2、maps.put("message", "100");
} catch (Exception e) {
// TODO: handle exception
}
return maps;
}
后端实体对象直接

3、 @InitBinder
public void initBinder(WebDataBinder binder){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true));
}
后端必须配置,springmvc 默认不会自动转换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>

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>

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>

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;
}
