Dear Folks,
While implementing HttpService for the JBoss OSGi integration I came
across an inconsistent API issue.
The specification sais:
Alternatively, the resource registration could have used a
default HttpContext object, as demonstrated in the following
call to registerResources:
getHttpService().registerResources(
"/files",
"/com/acme/www",
null
);
In this case, the Http Service implementation would call the
createDefaultHttpContext() method and use its return value
as the HttpContext argument for the registerResources method.
The default implementation must map the resource request to
the bundle’s resource, using Bundle.getResource(String).
An implementation of the default HttpContext has however no knowledge of
the callers bundle. The fundamental question is which bundle should
HttpContext.getResource(String) use for the default HttpContext?
This issue also applies when a servlet is registered with the default
HttpContext. A call to ServletContext.getResource(String) cannot access
the bundle that registered the servlet.
AFAICS, the only bundle available to the default HttpContext is that of
the HttpService itself, but not that of the caller.
cheers
-thomas
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev