Saturday, June 11, 2016

Quick Solution: Injecting one managed bean into property of another managed bean in JSF 2.0

I've One managed bean RegistrationBean  where all of my variable mapped to XHTML file.

And I want to inject / include this bean into RegistrationController bean.

For this purpose I use @ManagedProperty annotation in RegistrationController.

This annotation is used to DI (Dependency Injection) one managed bean into a property of another managed bean.

Lets see the example.

Registration.xhml [Few Parts]


RegistrationBean.java [Few Parts]



RegistrationController.java [Mandatory parts]


Hope you understand.....



No comments:

Post a Comment