0
可能重複:
Grails: displaying created image in gspGrails:如何在<g:each>標籤中顯示圖片?
我想在<g:each>
標記來顯示從數據庫中的圖像。
我域級:
class Artists {
byte[] image
String artistName
String bio
static constraints = {
image(nullable:true , maxSize:200000)
artistName(nullable:true)
bio(nullable:true, maxSize:2000)
}
}
和artists.gsp:
<g:each in="${dog.Artists.list()}">
<g:img src="${it.image }" width="120" height="160"/> //doesn't work, what should I do here???
<p>Name: ${it.artistName}</p> //works
<p>Biography: ${it.bio}</p> //works
</g:each>
幫助請!