Not an answer specifically for JSF (this might be), but for OSGi web-apps in general take a look at Pax-Web if you're using maven.
The easiest way to get started with Pax-Web is probably to use Karaf and then run the command features:install war
Once a WAR (or WAB - Web App Bundle) is deployed you'll be able to use the
osgi-bundlecontext attribute in Servlet initialization, eg:
extends HttpServlet {
BundleContext bundleContext;
@Override
public void init() throws ServletException
{
bundleContext = (BundleContext) getServletContext().getAttribute("osgi-bundlecontext");
}
Using this you can look up services in the OSGi registry.
You'll need to pay attention to the bundle's MANIFEST.MF entries, two in particular:
Bundle-ClassPath: ./,WEB-INF/classes
Webapp-Context: context-root-name-here
Or in an OSGi compliant WebApp container you'll need to add:
Web-ContextPath: context-root-name-here
There's more info in the specifications, see the enterprise or compendium PDFs for v4.2
EDIT: For deploying in JBoss you'll most likely want to use the WAB support, see section 128 of the enterprise 4.2 spec. Also this may help: http://community.jboss.org/message/619443
Interestingly JBoss AS7 is using pax-web, so the documentation for this should largely apply too.