Is it actually possible to pass any data between managed components in JSF? If yes, how to achieve this?
Could anyone provide any sample?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several ways. If the managed beans are related to each other, cleanest way would be injection. There are different ways depending on JSF version and whether beans are managed by CDI.
CDI
Just use
@Inject.Other way around can also, the scope of the source and target bean doesn’t matter because CDI injects under the covers a proxy.
JSF 2.x
Use
@ManagedProperty.Other way around is not possible in this specific example because JSF injects the physical instance and not a proxy instance. You can only inject a bean of the same or broader scope into a bean of a particular scope.
JSF 1.x
Use
<managed-property>infaces-config.xml.See also: