|
|
This post has NOT been accepted by the mailing list yet.
I realize this is an odd question but I'm wondering if there is a way to render XML stored in a database to the browser. The app I'm working on has file uploading capabilities allowing xml files to be uploaded as BLOB types (don't ask) but I'm unsure as to how I can write this data to the browser. I created a renderXml action as shown below, but I'm having trouble displaying the XML in the browser. Can this be done?
def renderXml = {
def fraudConfigurationInstance = FraudConfiguration.findById(1)
if (fraudConfigurationInstance?.xml) {
response.setContentLength(fraudConfigurationInstance.xml.length)
response.outputStream.write(fraudConfigurationInstance.xml)
} else {
response.sendError(404)
}
}
}
|