Best way to pretty print XML response in grails

后端 未结 4 2082
耶瑟儿~
耶瑟儿~ 2020-12-15 10:17

Given this in a grails action:

def xml = {
    rss(version: \'2.0\') {
        ...
    }
}
render(contentType: \'application/rss+xml\', xml)
<
4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 10:40

    Use XmlUtil :

    def xml = "" +
       ""
    
    println XmlUtil.serialize(xml)
    

提交回复
热议问题