English 中文(简体)
带有地图的具有约束力的指挥物体数据
原标题:Grails data binding- command objects with Maps

Grails 2.0.3 I am having problem with binding the data to command objects. I have the jquery request like this http://localhost:8080/api/test.json?callback=jQuery17102313091890902648_1334273415631&ex[0][a]=a0&ex[0][b]=b0&ex[1][a]=a1&ex[1][b]=b1

我需要一种方式,使请求书状中的数据具有约束力,以指挥物体。 类似情况

class TestCommand
{
    List<Map<String, String>> ex
    static constraints = {}
}

我想对数据进行动态约束,以便我能够从[0]a =0和[0]b = b0中获取,并直接在控制器中使用。 这份名单被罚款。 但是,没有绘制地图清单。 是否有办法对数据加以约束。

问题回答

http://grails.org/doc/latest/ref/Controllers/bindData.html”

毕竟,你如何(通过使用 j或常规的GET方法)提出你的要求,是解决服务器方面的问题。





相关问题
grails + gwt request handling via controllers

I am new to gwt. I am trying to integrate gwt+grails.Can anybody provide me a good example for handling the request using grails controllers and not a custom servlet.I will be really thankful if ...

Error loading the grails gwt module xml

I ve installed the plugin from this article by Peter http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w.... While compile time its not able to find the module file which is present ...

Sorting Objects Based on Custom Domain Class Methods

I have a domain class, in which I ve defined some methods which give the object a score based on different algorithms (eg. popularity). I now want to retrieve a list of these objects sorted by one of ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

热门标签