List records = sqlwx.getList(Record.class);
return records;
17 回复
第一次做,不是很懂,这里是view的jquery的ajax成功后的执行
success:function(data){
alert(data);
$.each(data,function (i,item) {
alert(item["MasterID"]);
})
}
拿到了个undefined
集合与否没有区别的,对后端来说
@At
@Ok("json:full")
public Object xxxx() {
List records = sqlwx.getList(Record.class);
return records;
}
if(wxponid == null || wxponid.isEmpty()){
//控制反转获取数据库位置
Ioc ioc = new NutIoc(new JsonLoader("e:/wms.chaoyipei.net/wk-app/wk-web/src/main/resources/config/ioc/dao.json"));
DataSource ds = ioc.get(DataSource.class);
//创建dao工具类
Dao dao = new NutDao(ds);
String wxstr=strsql;
wxstr+=cnd.toString();
System.out.println("sql语句"+wxstr);
Sql sqlwx=Sqls.queryRecord(wxstr);
sqlwx.setPager(dao.createPager(1,3));
dao.execute(sqlwx);
List<Record> records = sqlwx.getList(Record.class);
return records;
}
刚入行的小白,求大佬指教啊
天啊, 竟然有这样的代码...
Ioc ioc = new NutIoc(new JsonLoader("e:/wms.chaoyipei.net/wk-app/wk-web/src/main/resources/config/ioc/dao.json"));
DataSource ds = ioc.get(DataSource.class);
Dao dao = new NutDao(ds);
统统删掉, 改成属性注入
@Inject private Dao dao;
添加回复
请先登陆