Spring beans injected into JSF Managed Beans

前端 未结 2 1622
予麋鹿
予麋鹿 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:40

    First of all and I think this your problem that DelegatingVariableResolver is deprecated in all JSF version after 1.1 and you are using 1.2 so please use this following configuration.

    <application> 
    <el-resolver> 
    org.springframework.web.jsf.el.SpringBeanFacesELResolver 
    </el-resolver> 
    </application>
    

    Hope it helps.

    0 讨论(0)
  • 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;
        ....
    }
    
    0 讨论(0)
提交回复
热议问题