On 10/19/06, Nikunj Mehta <[EMAIL PROTECTED]> wrote:
I am new to OSGI and I am trying to use OSGI for a web app. Is it legal
in OSGI to register a wild card alias with HttpService?

I hope you understand Peter's reply. OSGi Http Service specification is explicitly made simple, and therefor doesn't support aliases such as "*.jsp", which I assume you are fishing for.


Now that said, that is specification. Nothing stops you from introducing your own servlet handler which could extend the spec behaviour. You would then to some extent sacrifice being compatible with all other implementations.

You could either;
 1. Create your own Http service, which describes this extended behavior,
 2. Create a WhiteBoard pattern servlet registration mechanism.

The latter is about creating a BundleA which registers a ServletB with the standard Http Service. It also looks for Servlets being registered to the OSGi Framework as a service, and if found looks for a particular service property which contains the 'pattern'. That pattern and reference to the registered servlet is handed to the ServletB.
Now, those servlets that require the pattern-matching, does not look up the Http Service and register themselves there, but instead register the servlet in the OSGi frameworks service registry, i.e. bundleContext.registerService (). You may need to do something similar for resources.

In fact, I think that this usage pattern should be the default way of the spec and with a little nudge, perhaps we could see this coming into a future spec... <nudge> <nudge>


Cheers
Niclas
_______________________________________________
OSGi Developer Mail List
osgi-dev@bundles.osgi.org
http://bundles.osgi.org/mailman/listinfo/osgi-dev

Reply via email to