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 はすべてをバッファリングしています。どうすればこれを機能させることができますか? ありがとう!