is it possible to run JSF 2.0 Application as Spring Web Bundle? Is there any OSGi support for JSF 2.0? I didn't found any OSGified bundles for Apache MyFaces 2.0开发者_运维百科.
Thanx in advance
In case you're still interested. Yes it is possible. On the Virgo forums I know someone has got it running with the PrettyFaces lib e.g.
But you ask "Is there any OSGi support for JSF 2.0"...
the fact is (if I get it well... I'm still just learning OSGi) that you should look at it from the other point of view, meaning, is the JSF 2 stack structured/clean enough for being able to come nearer to the world of OSGI'ified zen. :)
Please keep this thread updated in case you find something useful. I'm putting a lot of time and effort in figuring this mess out and hope I'll be able to share a decent answer with you.
Best wishes,
Jochen
10 month old thread, but posting this link if it helps someone: 'simple JSF 2 application on Virgo 3.0.0.RELEASE' -- http://www.eclipse.org/forums/index.php/mv/msg/203215/724346/#msg_724346
It's a great start for using JSF 2 in an OSGi envmt (Virgo Tomcat to be specific). From there to making it work with Spring dm is a short hop.
- add SpringBeanFacesELResolver to your faces-config.xml
- add a WEB-INF/applicationContext.xml where you define your beans
- in your web.xml add: (i) a contextClass param and set it to org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext, (ii) the Spring ContextLoaderListener
Create a META-INF/spring/osgi-context.xml where you declare/reference your Spring bean as an OSGi service:
...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"/>
HTH someone.
精彩评论