Java-Spring-eleaf数据表不工作

Java-Spring-eleaf数据表不工作,java,spring,thymeleaf,dandelion,Java,Spring,Thymeleaf,Dandelion,我想将dandelion数据表与thymeleaf一起使用。我的html文件如下: <table id="myTableId" dt:table="true" dt:url="@{/dataTable}" dt:serverside="true" dt:processing="true" dt:deferLoading="10"> <thead> <tr> <th

我想将dandelion数据表与thymeleaf一起使用。我的html文件如下:

<table id="myTableId"
     dt:table="true"
    dt:url="@{/dataTable}"
    dt:serverside="true"
    dt:processing="true"
    dt:deferLoading="10">
    <thead>
        <tr>
            <th dt:property="id">Id</th>
            <th dt:property="name" dt:default="My default value !">name</th>
            <th dt:property="state">state</th>
        </tr>
    </thead>
</table>

身份证件
名称
状态
控制器:

@RequestMapping(value="/dataTable")
public @ResponseBody DatatablesResponse<ApplicationItem>  allAppForTable(@DatatablesParams DatatablesCriterias criterias){

    List<Application>  appList=service.listApplications();
    List<ApplicationItem>  aa=new ArrayList<>();

    for(Application a:appList){

        ApplicationItem ai= new ApplicationItem();
        ai.setId(a.getId());
        ai.setName(a.getName());
        ai.setState(a.getState());
        aa.add(ai);
    }
    Long count=(long)appList.size();
    DataSet<ApplicationItem> dataSet=new DataSet<ApplicationItem>(aa, count,null);


    return DatatablesResponse.build(dataSet, criterias);
}
@RequestMapping(value=“/dataTable”)
public@ResponseBody datatableresponse allAppForTable(@datatableparams datatablecriterias criterias){
List appList=service.listApplications();
列表aa=新的ArrayList();
用于(应用程序a:应用程序列表){
ApplicationItem ai=新的ApplicationItem();
ai.setId(a.getId());
ai.setName(a.getName());
ai.setState(a.getState());
aa.加入(ai);
}
长计数=(长)appList.size();
数据集数据集=新数据集(aa,count,null);
返回DataTableResponse.build(数据集、标准);
}
但当我进入此页面时,表是空的。当它第一次加载时,我如何初始化表。

根据
dt:deferLoadgin
属性:

。。。允许您指示DataTables不要发出初始请求,而是使用页面上已有的数据(不会对其应用排序等)


尝试从
表的定义中删除
dt:deferLoading=“10”
属性

您可以发布控制器的代码吗?您是否考虑过使用没有蒲公英的数据表?至少这样是有一个错误,DataTables会抛出一个警报,可能,您没有在SpringTemplateEngine中注册dandelion方言。我的项目是spring4,但DataTables的最新版本是spring3。这可能是失败的原因。