public Object data(@Param("unitid") String unitid, @Param("loginname") String loginname, @Param("username") String username, @Param("length") int length, @Param("start") int start, @Param("draw") int draw, @Param("::order") List<DataTableOrder> order, @Param("::columns") List<DataTableColumn> columns) {
8 回复
具体怎么写 @Param 就可以了么 我貌似接受不到
{
"draw": 2,
"start": 0,
"length": 10,
"search": null,
"order": null,
"columns": null
}
返回结果是这个
提交的表单数据
draw:2
columns[0].data:id
columns[0].searchable:true
columns[0].orderable:false
columns[0].search.regex:false
columns[1].data:name
columns[1].searchable:true
columns[1].orderable:true
columns[1].search.regex:false
columns[2].data:deviceSn
columns[2].searchable:true
columns[2].orderable:true
columns[2].search.regex:false
columns[3].data:cdtu.cdtuSn
columns[3].searchable:true
columns[3].orderable:true
columns[3].search.regex:false
columns[4].data:status
columns[4].searchable:true
columns[4].orderable:true
columns[4].search.regex:false
columns[5].data:id
columns[5].searchable:true
columns[5].orderable:false
columns[5].search.regex:false
order[0].column:1
order[0].dir:asc
start:0
length:10
search.value:2
search.regex:false
接受的DTO
package com.yling.common.page.datatables;
import java.util.List;
public class DataTablesInput {
private Integer draw;
/**
* 开始位置
*/
private Integer start;
/**
* 长度
*/
private Integer length;
/**
* 全局搜索条件
*/
private SearchParam search;
/**
* 排序
*/
private List<DataTablesOrder> order;
/**
* 字段搜索
*/
private List<DataTablesColumn> columns;
public Integer getDraw() {
return draw;
}
public void setDraw(Integer draw) {
this.draw = draw;
}
public Integer getStart() {
return start;
}
public void setStart(Integer start) {
this.start = start;
}
public Integer getLength() {
return length;
}
public void setLength(Integer length) {
this.length = length;
}
public SearchParam getSearch() {
return search;
}
public void setSearch(SearchParam search) {
this.search = search;
}
public List<DataTablesOrder> getOrder() {
return order;
}
public void setOrder(List<DataTablesOrder> order) {
this.order = order;
}
public List<DataTablesColumn> getColumns() {
return columns;
}
public void setColumns(List<DataTablesColumn> columns) {
this.columns = columns;
}
}
Controller
@At("/test")
public DataTablesInput testDataTables(@Param("..") DataTablesInput input)
{
return input;
}
@wendal 求解 问题出现在哪里
添加回复
请先登陆