Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个大型现有应用程序,其中包含一堆通过JSF 的 ioc注入的托管 bean 。
我想开始将东西自动装配到这些 bean 中。目前我不能这样做,因为这些 bean 不是通过 spring 创建的。
解决这个问题的最简单方法是什么?
您可以使用特殊的 EL 解析器(在 faces-config.xml 中)让 spring 控制 JSF 注入:
<el-resolver> org.springframework.web.jsf.el.SpringBeanFacesELResolver </el-resolver>
如果您使用的是 JSF 2.0,建议您尝试 CDI(上下文和依赖注入)