| Summary: | [http] Upgrade HttpService support of Servlet API to 2.3/2.4 | ||
|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Simon Kaegi <simon_kaegi> |
| Component: | Compendium | Assignee: | equinox.compendium-inbox <equinox.compendium-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | arunbhatj, backhous, bogofilter+eclipse.org, curtispd, ed.burnette, gunnar, harald, jeffmcaffer, jfogell, pmuellr, toddsing |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Attachments: | |||
|
Description
Simon Kaegi
Created attachment 36944 [details]
Jetty based Http Service project archive
Here's a stand-alone Jetty Based Sevlet 2.4 Http Service.
It doesn't support Https right now but is otherwise fully functional and as far as I know spec complete.
The packaging is mainly illustrative as what I've done here is simply re-used the servlet bridge ProxyServlet. e.g. different Activator and dependencies but otherwise same code.
Some re-packaging would be needed here but I think it might be a good idea if we could share the same code in both of the HttpService implementations. Mapping a servlet container to the HttpService is tricky.
Also, the bundle's size is "much" larger than it needs to be as a bunch of stuff we won't need is packaged for now.
Any comments?
Created attachment 36961 [details]
same as last but with SSL support
Adding basic (but configurable) SSL support
Created attachment 37025 [details]
org.eclipse.equinox.http.proxy project
This project holds the ProxyServlet code and all of it's underlying implementation.
The idea is that a servlet container implementation registers an instance of the ProxyServlet (in its container) and then advertises it as a service.
All this bundle does is listen for ProxyServlets in the service registry and then uses them to create OSGi HttpService instances. Take a look at the Activator.
This decouples the OSGi Http Service implementation from the servlet container. It also makes it trivial to use existing servlet containers to provide an OSGi HttpService. I'll add some examples.
Created attachment 37026 [details] org.eclipse.equinox.http.jetty Using Jetty as the underlying servlet container. Other than the Jetty implementation jars (in /lib) this consists of just the Activator - e.g. integrated with approx. 100 lines of code. Note: this is using Jetty 5 which is a servlet 2.4 container. (You might get the patch Servlet 2.4 API bundle patch from bug 130561) Created attachment 37028 [details]
org.eclipse.equinox.servlet.bridge.http
A bit of a special case, but the servlet bridge can be integrated in about 10 lines of code. I'm more just trying to demonstrate the possibility of using the same code-base here.
Created attachment 37136 [details]
update org.eclipse.equinox.http.jetty
Cleanup...
Removed org.mortbay.jmx.jar to cut down size
Setting context work area to use the osgi provided area
Changed the boolean parse to let us use ee.minimum
To move forward we need contributeion questionnaires or all the new bits (Jetty, commons logging, servlet 2.4 api). Simon has agreed to do that. Created attachment 37480 [details]
org.eclipse.equinox.jetty.http
This project is all that's needed now for trying this out.
It uses the functionality provided in org.eclipse.equinox.servlet.bridge.http from HEAD directly.
So at a minimum you'll need the following bundles:
org.eclipse.osgi
org.eclipse.osgi.service
org.eclipse.jetty.http
org.eclipse.servlet.api [with 2.4 support]
org.eclipse.servlet.bridge.http
Moving out of NEW inbox. This enhancement is not suggested for 3.2, right? IMO it is too late for that. Hi Tom, I wish it was for 3.2 however there are a lot of dependencies. 1) We need to upgrade the Servlet API bundle to 2.4 2) The servlet bridge has to be promoted out of the incubator 3) We have to get the legal ok for the new 3rd party jars ...perhaps a better way is to start it in the incubator and promote it from there? Just peeked at the plugin attachment dated 2006-04-02. Yay! (I'm a jetty fan-boy.) Glad to see it brought into the fold. However, I wonder about the current bundling. We're also currently using Jetty, but we've bundled the mortbay code as a separate bundle; just the mortbay code. The commons.logging and commons.codec bits are likewise separate bundles. Seems like that shipping separate bundles is a more flexible way to do this, especially if there are other folks who'd like to take advantage of jetty (or even commons.logging). It would be a real shame, and complicated/impossible to boot, if the jetty code ends up shipping this way, and then we have to ship yet another version of it. Hi Patrick, Yep. Separate bundles is the plan. The current packaging is more illustrative and once we have sign-off we can take a closer look at packaging. yes. and feel free to contribute your metadata for the bundles. This might save some time. Created attachment 44689 [details]
org.eclipse.equinox.jetty project
This is the project for a binary bundle containing just the org.mortbay.* classes and no custom code.
Created attachment 44690 [details]
org.eclipse.equinox.jetty.http project
This project contains just the Activator that uses code from servlet.bridge.http to create an embedded Http Service based on Jetty (5.1.11).
Created attachment 45314 [details]
org.eclipse.equinox.jetty.http project
The previous version was lazy and would not start the HttpService until there was an incoming request. Updated so that the HttpService is activated immediately.
Created attachment 48764 [details]
org.eclipse.equinox.jetty6 project
Quick update...
We're still waiting for approval for Jetty 5.1.11 (I've heard it just needs to be voted on at the next meeting).
--
Jetty 6 is planning on releasing soon. Here's a very quick integration with Jetty 6rc2. We might look to do more with this version once it's been formally released. (Note: requires Java 1.4)
Created attachment 48765 [details]
org.eclipse.equinox.jetty6.http project
are you going to go for approavle on Jetty 6? Yes. I'll start working on it as well as it's dependencies (Servlet 2.5 and SLF4J) Jetty 6 was released not quite a month ago so I'd suggest we wait for a few minor releases and then do some testing first before settling on a particular version. Still we can start the ipzilla ball rolling... The integration work can be done in the incubator once the various dependencies are sorted out. I think this can be closed now. The Jetty (v5.1.11) based HttpService is graduated and available in the main eclipse and tools/Orbit depots. The relevant projects are: (Eclipse) - org.eclipse.equinox.http.jetty - org.eclipse.equinox.http.servlet (Tools) - org.eclipse.orbit/javax.servlet (v2_4) - org.eclipse.orbit/org.mortbay.jetty (v5_1_11) - org.eclipse.orbit/org.apache.common.logging (v1_0_4) -- I'll go ahead with getting Jetty 6 approval and we can continue that work in the incubator. Guys ,I tried using the HTTPService to run my 2.4 servlets but that didnt help. But the registration there to start the HttpService was simple. Now it looks like using Jetty is the only way to run servlets with 2.4 spcification. But I dont know how to create a HTTP Service with Jetty that listens on a port and register a servlet similar to the HTTP Service. I urgently need this. Please help !! Please mail me at arunbhatj@gmail.com Full support for this is provide with the Jetty based implementation. Take a look at the sections where Jetty is mentioned at http://www.eclipse.org/equinox/server/http_in_equinox.php If you need further help you should use the equinox newsgroup. |