gpt4 book ai didi

xml - 在Grails问题上呈现XML响应

转载 作者:行者123 更新时间:2023-12-02 14:05:12 25 4
gpt4 key购买 nike

我在将通过XMLSlurper解析的XML文件呈现为XML变量时遇到问题。
下面是我的代码。

def userFile =新文件(“test.xml”)
def xml =新的XmlSlurper()。parse(userFile)

渲染XML

问题是我看不到xml正在呈现到我的flex应用程序中。

最佳答案

如果只想呈现xml文件,则可以说:

    def xmlFile = new File("test.xml")
response.contentType = "text/xml"
response.outputStream << xmlFile.text

而且根本不需要拖尾

关于xml - 在Grails问题上呈现XML响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2064978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com