我需要在使用response.outputStream后重定向 我是grails的新手,所以我可能不知道是否有一种简单的方法。或者,如果它是可能的。 这是片段:
def filename = "ProgramA14_"+DASelected+"_backup.csv"
def filecontent = response.outputStream
response.setHeader("Content-disposition", "attachment; filename="+filename)
response.contentType = "text/csv"
filecontent << "program,da,area,date,forecastedReportedCumulative,forecastedReportedLow,forecastedReportedUpper,forecastedCorrectedCumulative,openPronto,openProntoLow,openProntoUpper,forecastedReportedWeekly,forecastedCorrectedWeekly\n"
flash.message = "Sample Flash message."
redirect(action:list, params:[programA14InstanceList: programA14DA, programA14InstanceTotal: programA14DA.count()])
}