Image byte [] to response.outputStream in Grails leads to “Cannot forward after response has been committed”

后端 未结 2 1181
不思量自难忘°
不思量自难忘° 2020-12-21 06:46

In my Grails controller I have an image as byte []. I want to write this byte [] directly to the response.outputStream

I use the following code to do that:

2条回答
  •  爱一瞬间的悲伤
    2020-12-21 07:11

    Grails don't know that you've already processed response, and if you aren't returning anything grails tries to apply default logic.

    Put

    return null
    

    at the end of your action.

提交回复
热议问题