【问题标题】:JSF 2.0 Application as Spring Web BundleJSF 2.0 应用程序作为 Spring Web Bundle
【发布时间】:2011-04-14 02:50:24
【问题描述】:

是否可以将 JSF 2.0 应用程序作为 Spring Web Bundle 运行?是否有任何对 JSF 2.0 的 OSGi 支持?我没有找到任何适用于 Apache MyFaces 2.0 的 OSGified 包。

提前感谢

【问题讨论】:

    标签: spring osgi jsf-2


    【解决方案1】:

    如果您仍然感兴趣。对的,这是可能的。在 Virgo 论坛上,我知道有人使用 PrettyFaces lib 运行它,例如

    但是你问“JSF 2.0 是否有任何 OSGi 支持”...

    事实是(如果我做得好......我仍然只是学习 OSGi)你应该从另一个角度来看它,意思是 JSF 2 堆栈的结构/干净是否足以能够更接近 OSGI'ified zen 的世界。 :)

    请保持此线程更新,以防您发现有用的东西。我花了很多时间和精力来解决这个问题,希望我能够与您分享一个体面的答案。

    祝你好运,

    乔辰

    【讨论】:

      【解决方案2】:

      10 个月大的帖子,但如果对某人有帮助,请发布此链接: 'Virgo 3.0.0.RELEASE 上的简单 JSF 2 应用' -- http://www.eclipse.org/forums/index.php/mv/msg/203215/724346/#msg_724346

      这是在 OSGi envmt(具体来说是 Virgo Tomcat)中使用 JSF 2 的一个很好的开始。 从那里到使它与 Spring dm 一起工作是一个短暂的跳跃。

      1. 将 SpringBeanFacesELResolver 添加到您的 faces-config.xml 中
      2. 在您定义 bean 的位置添加 WEB-INF/applicationContext.xml
      3. 在您的 web.xml 中添加:(i) contextClass 参数并将其设置为 org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext,(ii) Spring ContextLoaderListener
      4. 创建一个 META-INF/spring/osgi-context.xml,在其中声明/引用 Spring bean 作为 OSGi 服务:

        ...http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd" xmlns:osgi="http://www.springframework.org/schema/osgi">
        
            <osgi:reference id="springBeanId" interface="exposed.service.interface"/>
        

      某人。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-05-11
        • 2012-01-11
        • 1970-01-01
        • 1970-01-01
        • 2011-06-23
        • 2015-09-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多