We were actually talking about exactly this sort of thing in the office yesterday: we were discussing ways of making the styling of a Web bundle pluggable. The two candidates were to use a fragment that attaches to the Web bundle, and to make the Web bundle a Slice Host and use a Slice to provide the styling. We didn't get much beyond this in the discussion so we don't have any definitive recommendations to make at this stage.
Originally Posted by dsklyut
A key thing to note is that in the fragment bundle approach, the fragment will only add things to the classpath of the Web bundle, it won't add entries to the area on the filesystem that Tomcat can see, and from which it can directly serve static content. This means that you'd have to use some form of ResourceServlet that used the Web application's classloader to locate and server static resources. Using a Slice would not have this restriction and is probably a more elegant approach.
Yes, they can.
Can fragments be attached to shared services web bundles?
Yes, they are treated as bundles.
What is the final symbolic name of the deployed web bundle? Is it even treated as a bundle?
If no Bundle-SymbolicName is specified, then one is generated. The generated BSN is simply the name of the war file that you installed, e.g. if you install foo.war the bundle that's generated from the war will have a Bundle-SymbolicName: foo.war header.
Rather than relying on this generation, you can update the MANIFEST.MF in your WAR file to specifying a Bundle-SymbolicName. The installation of the WAR will only generated a Bundle-SymbolicName if one is not already present in the manifest.
The bundle that's generated from the WAR should definitely be visible in the console. Hopefully now that you know what the bundle's BSN will be, it'll be a little easier to spot it.
Looking at osgi console I did not see a deployed war file. (this is most likely an RTFM issue on my part, but still please help )