Thursday, February 9, 2012

JSF Managed Bean

Today I made some changes JSF managed beans using annotation instead of XML. Below it is the example.


@ManagedBean(name="themeSwitcherBean") -- Declare it as managed bean
@RequestScoped
public class MyThemeSwitcherBean {

@ManagedProperty(value = "#{userAccountService}") -- How to reference spring bean or other managed bean.
UserAccountService userAccountService;

No comments:

Post a Comment