用@ResponseBody
@RequestMapping(value = "/address", method = RequestMethod.POST)
@ResponseBody
public MapaddressPOST() {
Mapmap = new HashMap<>();
ReceivedGoodsAddress receivedgoodsaddress=new ReceivedGoodsAddress();
Listlist = addressService.findReceivedGoodsAddress(receivedgoodsaddress);
map.clear();
map.put("list", list);
return map;
}
//前台用jquery+ajax
$.ajax({
type:'POST',
url:'${contextPath}/address',
dataType:'json',
success:function(data){
$.each(data.list,function(i,item){
alert(i);
alert(item.id);
alert(item.name);
});
}
});
@RequestMapping("fileUpload")
public String fileUpload(@RequestParam("file") MultipartFile file) {
}