使用spring框架的剑道UI服务器分页

使用spring框架的剑道UI服务器分页,spring,kendo-ui,Spring,Kendo Ui,请参见下面的Datasourcerequest.java,以获取您的信息 @RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") @ResponseBody //public String listAssetsJSON(@RequestParam(value = "page", required = false) Integer page

请参见下面的Datasourcerequest.java,以获取您的信息

@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
@ResponseBody
//public String listAssetsJSON(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
public String listAssetsJSON(@RequestBody DataSourceRequest request) throws Exception
{
    System.out.println("ttttt "+request.getPage()+" "+request.getPageSize());
我仍然将页面和页面大小设置为null。而且永远都做不好,为什么它不起作用?解决办法是什么,我做错了什么?我还需要定义什么?我学习了大部分教程

我还向datarequest添加了setter,同样的问题。

您也需要这个

public class DataSourceRequest {
    private int page;
    private int pageSize;
    private int take;
    private int skip;
    private HashMap<String, Object> data;
    public DataSourceRequest() {
        data = new HashMap<String, Object>();
    }
    public HashMap<String, Object> getData() {
        return data;
    }
    public int getPage() {
        return page;
    }
    public int getPageSize() {
        return pageSize;
    }
    public int getTake() {
        return take;
    }
    public int getSkip() {
        return skip;
    }
}
public class DataSourceRequest {
    private int page;
    private int pageSize;
    private int take;
    private int skip;
    private HashMap<String, Object> data;
    public DataSourceRequest() {
        data = new HashMap<String, Object>();
    }
    public HashMap<String, Object> getData() {
        return data;
    }
    public int getPage() {
        return page;
    }
    public int getPageSize() {
        return pageSize;
    }
    public int getTake() {
        return take;
    }
    public int getSkip() {
        return skip;
    }
}
<kendo:dataSource-transport-parameterMap>
   function(options){return JSON.stringify(options);}
</kendo:dataSource-transport-parameterMap>