Reputation: 16851
I need to have a hiddenfield
with the value of the current user logged in.
I know how to get the current user logged in. <sec:loggedInUserInfo field="username" />
But how can i set it to a hidden field ?
Upvotes: 0
Views: 4966
Reputation: 24776
It's simple enough. Something like this perhaps:
<input type="hidden" name="whateverYouWant" value="${sec.loggedInUserInfo(field: 'username')}" />
Or if you prefer to use the hiddenField tag:
<g:hiddenField name="whateverYouWant" value="${sec.loggedInUserInfo(field: 'username')}" />
Upvotes: 3