Spring beans injected into JSF Managed Beans

前端 未结 2 1727
予麋鹿
予麋鹿 2020-12-16 08:09

Problem Description: My injected Spring bean defined as a Managed-Property to a JSF backing bean is not being instantiated. Its always coming up null when I retreive the Man

2条回答
  •  生来不讨喜
    2020-12-16 08:49

    In addition to using SpringBeanFacesELResolver you can benefit even more from spring by using annotations. So instead of defining your managed bean in xml, just do:

    @Controller
    public class FooBean {
        @Inject
        private SpringService service;
        ....
    }
    

提交回复
热议问题