Grails: how to display images in tag? -


possible duplicate:
grails: displaying created image in gsp

i'm trying display images database in <g:each> tag.

my domain-class:

class artists { byte[] image string artistname string bio static constraints = { image(nullable:true , maxsize:200000) artistname(nullable:true) bio(nullable:true, maxsize:2000) } } 

and artists.gsp :

<g:each in="${dog.artists.list()}"> <g:img src="${it.image }" width="120" height="160"/> //doesn't work, should here??? <p>name: ${it.artistname}</p> //works <p>biography: ${it.bio}</p> //works </g:each> 

help please !!!

you can render image inline way you're attempting using rendering plugin, , following gsp tag (this png check inline images in docs other content types):

<rendering:inlinepng bytes="${it.image}"/> 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -