我想呈现包含缓存JSON的字段的JSON。我怎样才能做到这一点?Groovy/Grails - 在JSON中渲染缓存的JSON
实施例:
def cachedJSON = [cachedPropertyOne:'a', cachedPropertyTwo:'b'] as JSON
render([listEntryOne:'c', listEntryTwo:'d', cachedProperties: cachedJSON] as JSON)
与上面的代码的问题是,cachedProperties被转义。例如,"
变成\"
。
你的假设是正确的 - 我编辑了我的文章。不过,我希望有更高效的方式去实现它。 – Anonymous1