Grails的。域类。方法AddTo *?

时间:2010-11-27 22:30:50

标签: json grails

我有这个例子:

def mycreate = {

    def id = params.id;
    def data = JSON.parse(params.data);

    def credit = Credit.get(id);

    def front = new Front ();
    front.properties = data;

    credit.addToFronts(front).save()

    render (front as JSON)
}

此操作返回如下内容:

{"class":"test.Front","id":null,"credits":{"class":"Credit","id":1},"dateCreated":null,"description":"write text here."}

但是,对我来说,参数“id”和“dateCreated”是null。我怎样才能得到这些参数的值?

0 个答案:

没有答案