NutzCN Logo
问答 请问json 对象中包含一个对象 在json 传到后台怎么接收
发布于 3054天前 作者 CHQ 2428 次浏览 复制 上一个帖子 下一个帖子
标签: mvc

QQ截图20151209165649_png 7_G6C0_C94~N@_W__R3VH98_png

@AdaptBy(type=JsonAdaptor.class)
@At
@Ok("json")
public Object add(@Param("ar")Product ar,@Param("pimg")Img strg) {
System.out.println(strg);
/* List mg = new ArrayList();
for (String str:strg) {
Img g = new Img();
g.setImg(str);
g.setPid(ar.getId());
mg.add(g);
}
ar.setPimg(mg);*/
/*if(ar.getId() > 0){
ar.setCreateTime(productSer.fetchByID(ar.getId()).getCreateTime());
productSer.update(ar);
dao.updateLinks(ar, null);
return new NutMap().setv("ok", true);
}else{
Product pr = productSer.insert(ar);
dao.insertLinks(pr, null);
return new NutMap().setv("ok", true);
}*/
return new NutMap().setv("ok", true);
}

1 回复

@Param("::ar.")符号 '::'表示这个参数是一个表单对象,并且它有统一的前缀'ar.'表示前缀,Nutz.Mvc会遍历Product的所有字段

添加回复
请先登陆
回到顶部