This content has been marked as final.
Show 1 reply
-
1. Re: programmatically bind a component to a context variable?
pjot Apr 10, 2010 1:15 PM (in response to shin0135)"You can also programmatically bind a component to a context variable" means for instance:
Contexts.getSessionContext().set("currentUser", user);
"This is useful if a particular component serves more than one role in the system. For example, the currently logged in User might be bound to the currentUser session context variable" means:
@Name("user") @Role(name = "currentUser", scope = ScopeType.SESSION) public class User {}
The third option is to outject some component/value for example while navigation in the page.xml:
<out name="currentUser" value="#{user}" scope="SESSION"/>
I hope it helps