在Grails中使用Response.outputStream后,如何重定向并显示flash.message?

时间:2012-08-09 09:55:37

标签: grails

我需要在使用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()])
        }

0 个答案:

没有答案