Community
Participate
Working Groups
A few of the servlet-3.0 features are actually already available in jetty-7 although it uses servlet-2.5. This includes the support for web-fragment.xml and some of the servlet-3.0 annotations. This bug keeps track of the support for those features in jetty-7-osgi. Note that none of the support for those features is specified in the OSGi entreprise spec. So everyone is welcome to comment on how we are supporting those features in OSGi. In J2EE, web-fragment.xml and annotations are scanned in the WEB-INF/classes and WEB-INF/lib folder. In OSGi we suggest to scan them in the J2EE locations and add those locations: 1- OSGi fragment bundles hosted by the web-bundle. 2- Required-Bundles that have the attribute jetty-web=true They are both scanned for the web-fragment.xml and the servlet annotations 3- For annotations only: Import-Packages that have the attribute jetty-web=true This support will be developed in jetty-7. It is then merged in jetty-8.
Support for osgi fragment bundles that contain META-INF/web-fragment.xml and META-INF/resources is committed. The latest version of OSGi implemented by equinox supports a new API to introspect the dependencies of a bundle (the package org.osgi.framework.wiring). It would allow us to cleanly get the import packages required bundles and other info for a web-bundle. However it is not supported by felix. I think we need to parse the manifest headers we are interested in ourselves.
It is in fact not possible to define a custom attribute for Require-Bundle and Import-Package. At the moment, the default behavior is to assume that each required bundle behaves like a jar in WEB-INF/lib: it is looked up for the META-INF/resources, META-INF/*.tld, META-INF/web-fragment.xml, and the annotations are scanned. This behavior is also applied to the osgi fragments. If we need a different behavior we could introduce some custom headers in the manifest.
OK in fact annotations in jetty-7 are not discoverable: annotations on a servlet, a filter or a listener that are declared in a web.xml or in a web-fragment.xml are processed. But a class that is annotated to declare a servlet is not discovered. That is the realm of servlet-3.0 So marking this bug as fixed.