I\'m very new to Grails so there\'s probably a very simple answer to this question. I\'m trying to display a dynamically created image in a gsp. The image is NOT stored in
Your gsp:
Your controller:
def draw() {
byte[] imageInBytes = imageService.getImageInBytes() //should return byte array
response.with{
setHeader('Content-length', imageInBytes.length.toString())
contentType = 'image/jpg' // or the appropriate image content type
outputStream << imageInBytes
outputStream.flush()
}
}