Hi
With whiteboard (
https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.http.whiteboard.html#d0e90148)
you can register resources to be served from a bundle.
Real "static content" is best served from NGinx/proxy, but
Jetty/Tomcat/Undertow have own configs for that.
So to make it simple (serving from directory) you have to think outside of
OSGi.
With Pax Web Jetty feature comes default jetty.xml which contains this for
example:
<Set name="handler">
<New id="GzipHandler"
class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
<Set name="handler">
<Ref refid="OrigHandler" />
</Set>
</New>
</Set>
you can however configure different "handler" like
https://javadoc.jetty.org/jetty-9/org/eclipse/jetty/server/handler/ResourceHandler.html
- I can't give you XML snippet from top of my head, but you could try
asking ChatGPT :)
regards
Grzegorz Grzybek
pt., 20 lut 2026 o 19:33 Steinar Bang <[email protected]> napisał(a):
> Just a heads up: Google found me this stuff:
> https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.http.html#d0e2422
>
> Here is a possible approach:
> - I create an SQL table to store tuples of paths on disk and context
> paths
> - I create a super-simple web GUI to manage the table
> - I create code using the HttpService OSGi service to register
>
> I still haven't decided what to do, but it looks like this may be a
> servlet container neutral way of registering resources...?
>
> But it will require code on my part.
>
> Hm... thinking!
>
>