Community
Participate
Working Groups
The OSGi HttpService is hosted on the root context '/'. It is a common situation when migrating from a non-OSGi setup to have a web-application running on the root context '/'. The suggested behavior in this case is to make jetty route the request to the HttpService and if the HttpService issues a 404 to then dispatch it to the webapp on the root context. If it makes sense we could in fact support an optional parameter for every web application to first route the request to the HttpService and if the HttpService does not handle it to then route it to the webapps.
Currently, the Equinox HttpService is implemented as a servlet. IMHO it would be better to make it a filter instead. That would solve a lot of your issues. Another option would be to write a dedicated handler that re-implements some logic from the proxy servlet. Well, the logic could be refactored out of the proxy servlet into a shared class. The proxy servlet would just add the 404 response in case nothing was found.
Thanks Gunnar for pointing out that when the HttpService is implemented as a filter it will be a lot more flexible to host it in different situations. Let me know if there is a request for enhancement for that already. I'll file it otherwise.
Gunnar, Can you tell me if this issue is still current? What is happening with the suggestion that the Equinox HttpService be implemented as a filter instead? thanks Jan
Jan, For me this is not an issue. I don't know if there is an enhancement request for the Equinox HttpService open. However, I'm not sure if this request belongs into the Jetty bucket. The HttpService is implemented in Equinox, though. Do you still provide your own HttpService implementation? -Gunnar
Hi Gunnar, Yes, we provide the jetty-httpservice module, which when used with the jetty-osgi-boot module will deploy a context containing the Equinox HttpServiceServlet. See: https://github.com/eclipse/jetty.project/tree/master/jetty-osgi/jetty-osgi-httpservice I have no idea if anyone is using this or not, do you? thanks, Jan
This issue has been kicking around for a long time, but it seems to me as if it was raised as more of an idea than a concrete problem. There's been zero interest from the community in doing anything like this, so I'm going to close it as a won't fix. Jan