httpSession in Grails
问题 I need to access the domain class User of the current session. The following code works: class RatingController { def rate = { def rating = params.rating def artist = Artist.get( params.id ) def user = User.get(1) user.addToRatings(new Rating(artist:artist, rating:rating)) user.save() render(template: "/artist/rate", model: [artist: artist, rating: rating]) } } But instead of explicitly get the user with ID equal 1 (User.get(1)) I need to access the user of the current session. I tried the