域中寫如下代碼:
class Something{
byte[] image
}
控制器中展示圖片的方法
def image= {
def something = Something.get( params.id )
byte[] image = something.image
response.outputStream << image
}
頁面展示
<img src="${createLink(controller:'something', action:'image', id: something.id)}"/>
posted on 2010-04-01 19:52
周銳 閱讀(890)
評論(1) 編輯 收藏 所屬分類:
Groovy&Grails