The controller returns a map containing the data that you will (presumably) use in your view. The map keys are the names you use to this data from your view. Perhaps it would be a little less confusing if you renamed the map key, e.g.
def edit(Long id) {
def userInstance = User.get(id)
if (!userInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'user.label', default: 'User'), id])
redirect(action: "list")
return
}
[user: userInstance]
}
To get the id of the User
in your view, you would use:
${user.id}