Hi,

2011/3/28 Olivier Grisel <[email protected]>:
> For the static resource we use:
>
> httpService.registerResources(staticUrlRoot, staticClasspath, null);
>
> where currently staticUrlRoot is "/static" and staticClasspath is
> "/META-INF/static".
>
> One could have each contribution host their static resources in a
> specific named java package (e.g.
> org.apache.stanbol.enhancer.jersey.static) and register this package
> name incrementally on a dedicated URL prefix:
>
> httpService.registerResources("/static/enhancer",
> "org/apache/stanbol/enhancer/jersey/static", null);
> httpService.registerResources("/static/entithub",
> "org/apache/stanbol/entityhub/jersey/static", null);

Yes, this is similar to what I had in mind. Thank you.

> Note that the org.apache.stanbol.enhancer.jersey.static package must
> be marked in the list list of OSGi exported packages (Export-Package)
> of the the org.apache.stanbol.enhancer.jersey bundle (using the
> maven-bundle-plugin as usual).

Okay, I was not sure if exporting the package this way is enough. Cool.

> Note that this scheme does not allow for contributions to partially
> override previously registered resources though. But I think this
> scheme is simple enough to get us started. We will refactor later if
> we need to somehow implement some kind of incremental overrides.

Agreed, from my side.

- Fabian

Reply via email to