Well, you can use the springSecurityService function to get user information in the controller:
class MyController {
def springSecurityService
def myAction() {
def principal = springSecurityService.principal
String username = principal.username
...
}
}
Or in gsp
<sec:loggedInUserInfo field="username" />
This is a pretty general question.
source
share