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

时间:2024-10-15 11:04:00

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;"> <p>政府认证</p> </div> <div class="col-xs-6 col-md-4" style="border-right: 2px solid #eee;"> <p>质量保证</p> </div> <div class="col-xs-6 col-md-4"> <p>公司担保</p> </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类型的数据,后端如何接收
© 手抄报圈