<script type="text/javascript"> $(document).ready(function(){ $.ajax({ type:‘POST‘, url:‘<%=path%>/user/ceshi.do‘, dataType:"json", contentType:"application/json", data:JSON.stringify([{id:"1",name:"cehshi1"},{id:"2",name:"ceshi2"}]), success:function(){ } }); </script>
@RequestMapping(value = "/ceshi", method = {RequestMethod.POST }) @ResponseBody public void ceshi(@RequestBody User[] users){ for (User user : users) { System.out.println(user.getId()); } }
时间: 2024-11-05 09:49:54