$(document).ready(function () {
$.ajax({
url:"${pageContext.request.contextPath}/showFile",
type:"post",
dataType : 'json',
async : false,
data:{pageSize:'1',pageNo:'1'},
success:function(data){debugger;
alert("ok");
},
error:function(e){
alert("错误!!");
}
});
});
@RequestMapping(value="/showFile",method=RequestMethod.POST)
@ResponseBody
public Result register(Integer pageSize,Integer pageNo){
FileUp fileup=new FileUp();
fileup.setPageno(pageNo);
fileup.setPagesize(pageSize);
fileup.setRowto(pageNo*pageSize);
List<FileUp> file =fileservice.showfile(fileup);
PageInfo page = new PageInfo(file);
return Result.successResult(page);
}
后端数据没有转换成json,少了@ResponseBody标签