My code in gsp is this:
<g:link controller="user" action="show" id="${userInstance.id}">${userInstance.username.encodeAsHTML()}</g:link>
Error:
Exception Message: Cannot get property 'id' on null object
Caused by: Error evaluating expression [userInstance.id] on line [75]: Cannot get property 'id' on null object
My code in controller is:
def show = {
def userInstance = User.get(params.id)
if (!userInstance) {
flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'user.label', default: 'User'), params.id])}"
redirect(action: "list")
}
else {
[userInstance: userInstance]
}
}
I´m using:
grails-1.3.5
grails-shiro-1.1-SNAPSHOT
Please I need to know what is wrong here, my goal is to create a link to update user logged in profile. Thanks
<g:link controller="user" action="show" id="${userInstance.id}">${userInstance.username.encodeAsHTML()}</g:link>
Error:
Exception Message: Cannot get property 'id' on null object
Caused by: Error evaluating expression [userInstance.id] on line [75]: Cannot get property 'id' on null object
My code in controller is:
def show = {
def userInstance = User.get(params.id)
if (!userInstance) {
flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'user.label', default: 'User'), params.id])}"
redirect(action: "list")
}
else {
[userInstance: userInstance]
}
}
I´m using:
grails-1.3.5
grails-shiro-1.1-SNAPSHOT