ICEfaces JSF Beans 和 Spring Beans,什么 VariableResolver?

发布于 2024-10-01 18:11:43 字数 635 浏览 1 评论 0原文

我试图了解将 Spring(用于依赖注入)与 ICEfaces(Spring 3、ICEfaces 1.8.2、JSF RI 1.1)结合使用的最佳方法。 关于 Spring 参考手册,有几种可能性来处理 EL 解析的 Bean:

如果我使用 SpringBeanVariableResolver(乍一看效果最好):

  • EL 表达式中引用的 Bean 将由 Spring 管理
  • ,但缺少“扩展请求” -Spring的作用域会导致问题,不是吗?

如果使用 DelegatingVariableResolver:

  • EL-Expression 中引用的 Bean 将由 JSF 管理
  • 我需要在 faces-config.xml 中定义 EL 感知的 beans,这意味着我受到有限选项的限制(例如没有构造函数) DI)。
  • Bean 声明分散在不同的文件中,

这是正确的吗?有什么建议吗?提示?最佳实践?

I'm trying to understand the best way to use Spring (for dependency injection) with ICEfaces (Spring 3, ICEfaces 1.8.2, JSF RI 1.1).
Regarding the Spring reference manual, there are several possibilities to handle EL resolutions of beans:

If I use SpringBeanVariableResolver (which look best at first sight):

  • Beans that are refered in an EL-Expression will be managed by Spring
  • BUT the missing "extended request"-scope of Spring will cause problems, won't it?

If the DelegatingVariableResolver is used:

  • Beans that are refered in an EL-Expression will be managed by JSF
  • I need to define the EL-aware beans in faces-config.xml, which means I'm restraint to the limited options (e.g. no constructor DI).
  • Bean declarations are scattered across different files

Is this correct? Any suggestions? Hints? Best practices?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单身狗的梦 2024-10-08 18:11:43

我最终将常见的 JSF DI 与 Spring DI 混合在一起。这意味着我将 Spring bean 作为 JSF 托管属性注入。

I ended up in mixing common JSF DI with Spring DI. That means that I inject Spring beans as JSF managed properties.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文