This content has been marked as final.
Show 2 replies
-
1. Re: how to access produced field in EL?
ahhughes Dec 4, 2011 2:12 AM (in response to subaochen)You do not have a bean or producer qualified by the name
currentUser
, but you do have one namedlogin
and as you point out, this works.Sorry I can't test this and I don't guarantee this will work but...
Try adding a produces method that returns a User and is qualified by @Named(
currentUser
). This will just return the @LoggedIn User (i.e. currentUser) but it will qualify the el namecurrentUser
.@Produces @Named("currentUser") public User produceCurrentUserByElName(@LoggedIn User currentUser) { return currentUser; }
Fingers crossed it works for you :)
-
2. Re: how to access produced field in EL?
subaochen Dec 13, 2011 4:15 AM (in response to subaochen)Thanks Andrew! yes, missing @Named for currentUser, this will work:
@Produces @LoggedIn @SessionScoped @Named public User getCurrentUser() { return currentUser; }