NutzCN Logo
问答 适配器org.nutz.lang.born.BorningException
发布于 3054天前 作者 Hamming 2072 次浏览 复制 上一个帖子 下一个帖子
标签:

代码如下

    public class Ord{
        public Integer userId;
        public Integer addressId;
        public List<Integer> goodId;
    }

    @At("/add")
    @Ok("json")
    public Object Add(@Param("::od.") Ord od){
        ResOrd ro = new ResOrd();
        Bj_order ord = new Bj_order();
        ord.setOrd_user_id(od.userId);
        List<Bj_order_item> ordItem = new ArrayList<Bj_order_item>();
        if(od.goodId.size() > 0){
            for (Integer gId :od.goodId){
                Bj_order_item itemTemp = new Bj_order_item();
                itemTemp.setOrd_goods_id(gId);
                ordItem.add(itemTemp);
            }
        }else {
            ro.result = "03";
        }

        ro.msg = orderService.createOrder(ord, od.addressId, ordItem);
        if(ro.msg.equals("success")){
            ro.result = "01";
        }else {
            ro.result = "00";
        }
        return ro;
    }

POST 请求提交表单
od.userId = 1
od.addressId = 9
异常信息
WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/order/add :
org.nutz.lang.born.BorningException: Fail to born 'nuoshang.bluejay.modules.OrderModule$Ord'
by args: []
at org.nutz.lang.Mirror.born(Mirror.java:988)
at org.nutz.mapl.impl.convert.ObjConvertImpl.injectObj(ObjConvertImpl.java:190)
at org.nutz.mapl.impl.convert.ObjConvertImpl.inject(ObjConvertImpl.java:81)
at org.nutz.mapl.impl.convert.ObjConvertImpl.convert(ObjConvertImpl.java:65)
at org.nutz.mapl.Mapl.maplistToObj(Mapl.java:34)

1 回复

不支持非静态内部类.

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