JSF 2.0 [message #649440] |
Wed, 19 January 2011 04:10  |
Eclipse User |
|
|
|
Hi,
hopefully I'm not digging up something that was solved a long time ago - I have checked this forum and there are no topics dealing with this subject since last summer at least.
So, in trying to make a Virgo JSF application, I have come upon this issue: DMS-2874 and the discussions surrounding it.
The JSF bundles (API and implementation) that are referenced there are based on a prerelease version of JSF 2.0. I have managed to get full JSF 2.0 applications to mostly work by following the issue and discussions mentioned above, and replacing the content (and adding some missing exports) to the -PR2 bundles with the Mojarra 2.0.3 classes.
By "mostly working", I mean that the applications work if the JSF 2.0 implementation bundle is included in the WEB-INF/lib and added to Bundle-Classpath (so its classes are not "OSGi-provided" to the application). Additional issue is that there is no full support for EL 2.1 used with JSF 2.0 because the EL that is being used is 1.0 - retrieved by bundle dependencies.
With regards to everything just described, I have a few questions:
1. The EL issue stems from the fact that JSF API bundle (javax.faces) has an import for javax.servlet.jsp (version 2.1), which in turn has an import for javax.el (version 1.0). Both of the latter bundles are provided by Virgo, and if I try to pull javax.el (version 2.1, installed into repository/usr) directly to my web application as a dependency, I will get a classloader resolver conflict. Also, including that bundle in WEB-INF/lib does not work as the JSF implementation pulls in the Virgo-provided version when it initializes. What would be the most elegant way to solve this problem (apart from waiting for a future version of Virgo that will include Tomcat 7 which has JSF 2.0 support)
2. Is there a standard way to submit bundles to a centralized bundle repository (like the springsource's enterprise bundle repository) so that they are available to all Virgo developers (when they can be made to work)
3. Are there plans to make an "official" (meaning tested and proven to work) bundle repository for Virgo (or is the SpringSource repository what will be used for the future too)?
|
|
|
Re: JSF 2.0 [message #650003 is a reply to message #649440] |
Fri, 21 January 2011 07:19   |
Eclipse User |
|
|
|
Tin wrote on Wed, 19 January 2011 09:10 | Hi,
1. The EL issue stems from the fact that JSF API bundle (javax.faces) has an import for javax.servlet.jsp (version 2.1), which in turn has an import for javax.el (version 1.0). Both of the latter bundles are provided by Virgo, and if I try to pull javax.el (version 2.1, installed into repository/usr) directly to my web application as a dependency, I will get a classloader resolver conflict. Also, including that bundle in WEB-INF/lib does not work as the JSF implementation pulls in the Virgo-provided version when it initializes. What would be the most elegant way to solve this problem (apart from waiting for a future version of Virgo that will include Tomcat 7 which has JSF 2.0 support)
|
You would need to make sure the JSF implementation is wired to EL 2.1. It sounds like the current JSF bundles omit this version of EL from their import ranges in which case you'd need to replace the JSF bundles, so you may prefer to wait for Tomcat 7 support.
Quote: |
2. Is there a standard way to submit bundles to a centralized bundle repository (like the springsource's enterprise bundle repository) so that they are available to all Virgo developers (when they can be made to work)
|
You can raise a request against the Enterprise Bundle Repository as described in the FAQ, but SpringSource has limited resource to apply to such requests and so we can't say when the request would be acted upon.
You can puts bundles in Maven central. Various vendors and projects also support bundle repositories - an internet search should find them pretty quickly.
Quote: |
3. Are there plans to make an "official" (meaning tested and proven to work) bundle repository for Virgo (or is the SpringSource repository what will be used for the future too)?
|
Discussions started a while back around creating a bundle repository similar to the SpringSource Enterprise Bundle Repository at Eclipse, but I haven't seen much progress on that front to date. The contents would not be limited to Virgo and I doubt that there would be sufficient resources to ensure all the contents are tested and "proven to work".
|
|
|
Re: JSF 2.0 and Virgo 2.1 [message #650693 is a reply to message #650003] |
Wed, 26 January 2011 01:12   |
Eclipse User |
|
|
|
Thanks Glyn for the reply. Well I made it work, but it wasn't much fun, so you're probably right that the reasonable thing would be to just wait for next version of Virgo with Tomcat 7 included.
For anyone who's interested, there are basically two options for JSF2 with Virgo 2.1.
The first, and arguably the more correct one, would be to deploy the whole JEE 6 web stack (the servlet, jsp, jstl, el api and implementation and jsf api and implementation) as bundles into repository, and then import only the JSF bundles into your application. In theory this should work, and since Glassfish is OSGi-based, again in theory, most of the bundles should work with little to moderate tweaking.
The second option is the one I took, and that is:
1. "upgrade" the existing springsource JSF2 bundles with latest Mojarra (I did it by just replacing the whole package tree directly in the JAR and editing the existing MANIFEST, but I wouldn't recommend that, better to bundlize them properly with bnd or bundlor)
2. add the imports for all javax.faces.* packages to the implementation bundle's (com.sun.faces) manifest, and also make sure that both jsf bundles import javax.el version 2.2
3. add el-api-2.2.jar and el-impl-2.2.jar bundles (the first one found on the maven repos and bundlized, the second one stolen from Glassfish - meaning it's already a proper OSGi bundle) to the Virgo repository
4. edit existing servlet, servlet.jsp and catalina (and perhaps one or two I forgot) bundle manifests from Virgo's repository/ext and make sure they import javax.el versions 1.0.0 upto 3.0.0
5. to make it work with your OSGi service-aware WAR, import both the javax.faces and com.sun.faces bundles in your manifest
Again, I wouldn't recommend anyone to go with the second option, but since I was short on time, this was the quickest way to make it work.
One disclaimer: I'm not sure if the new EL will work with Jasper (JSP compiler in Tomcat), it should but I didn't try it as I'm using facelets which are the standard choice for JSF2 templating anyway.
Now onto making some of the JSF2 component libraries (PrimeFaces, IceFaces, OpenFaces, ...) working...
[Updated on: Wed, 26 January 2011 01:14] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.47143 seconds