0

使用 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()])
        }
4

1 回答 1

0

我认为您需要使用一次性数据插件

于 2012-08-17T11:56:53.173 回答