Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344910 - Ability to have both a web-bundle and the HttpService servlet on the root context '/'
Summary: Ability to have both a web-bundle and the HttpService servlet on the root con...
Status: CLOSED WONTFIX
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.4.0   Edit
Hardware: Other All
: P3 enhancement (vote)
Target Milestone: 9.0.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 00:07 EDT by Hugues Malphettes CLA
Modified: 2015-07-15 21:22 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hugues Malphettes CLA 2011-05-06 00:07:03 EDT
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.
Comment 1 Gunnar Wagenknecht CLA 2011-05-19 06:57:23 EDT
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.
Comment 2 Hugues Malphettes CLA 2011-05-20 01:23:25 EDT
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.
Comment 3 Jan Bartel CLA 2013-11-11 01:59:09 EST
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
Comment 4 Gunnar Wagenknecht CLA 2013-11-11 03:07:20 EST
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
Comment 5 Jan Bartel CLA 2013-11-11 03:18:27 EST
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
Comment 6 Jan Bartel CLA 2015-07-15 21:22:24 EDT
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