如何在没有扁平键的情况下打印Grails params

时间:2015-05-20 14:59:33

标签: grails dictionary flatten

Grails中的

params是GrailsParameterMap,它通过拆分包含点的参数名称自动构建子地图。

例如,如果我的查询字符串是?one.two.three=hello,那么Grails会给我一个params变量,其中包含展平(原始)和重新构造的值:

params == [
    "one.two.three": "hello",
    one: [
        "two.three": "hello",
        two: [
            three: "hello",
        ],
    ],
    // plus "controller parameters"
]

如果我们忽略其他"控制器参数",例如controlleraction,如何在没有原始展平参数的情况下获得干净版本?

[
    one: [
        two: [
            three: "hello"
        ]
    ]
]

0 个答案:

没有答案
相关问题