class MyController {
def startTwoMinuteTask = {
response.contentType = 'text/html'
def out = response.outputStream.destination
out.println 'Starting ...'
out.flush()
for (int i=0;i<10;i++) {
out.println " <br> $i"
out.flush()
Thread.sleep(1000)
}
return null
}
}
Я бы хотел, чтобы это отображало от 1 до 10 в качестве обновлений статуса, увы, Grails буферизует все это. Как мне заставить это работать? Спасибо!