0
每當我在我的template.gsp中調用<ut:profilePicture>
時發生錯誤。這是我的customTagLib已經爲此響應調用Grails getWriter()
import rms.User
class userTagLib {
def springSecurityService
static namespace = "ut"
def fullName = {
User currentUser = springSecurityService.currentUser as User
if (currentUser) {
out << currentUser.firstName + " " + currentUser.lastName
}
}
def profilePicture ={
User currentUser = springSecurityService.currentUser as User
if (currentUser){
response.outputStream << currentUser.picture
}
}
}
我需要發佈gsp代碼嗎?
但不會,如果在GSP輸出鏈接使用的標籤並不會顯示實際的圖片? – Jan
時間,你的意思是? –
'createLink(controller:'user',action:'profile',id:currentUser.id)'我試過了,'createLink'被強調並且輸出是'/ myProject/admin/picture/2' – Jan