A release candidate of Jetty 7.4 is now available as both Jetty@eclipse and Jetty-Hightide@codehaus distributions. This release contains a number of new features which I will briefly introduce now, and make the target of more detailed blogs, webinars and wiki pages over the next few weeks:
Jetty Overlay Deployer
Jetty now includes a deployer that is designed to allow a war file to be customised and deployed without modifying the original WAR file, which is kept immutable or even signed so that you know it is exactly as delivered. A WAR file is configured by applying a series of overlays, each of which may contain:
- A web.xml fragment to modify or add filter, servlet and other web.xml configuration.
- static content to add or replace static content in the war
- Classes and Jars to be added to the classpath
- Context configuration
Overlays can be created that are application specific, node specific or instance specific and multiple instances of the same application will share the common war and overlays. This sharing includes classloaders and static resource caches and greatly reduces the memory footprint of multi-tenanted deployments.
Overlays also allow easy identification of what configuration has changed in a deployed WAR, so that an overlay can be applied to an updated WAR and the configuration changes will be preserved.
Jetty Spring
Since almost the beginning, Jetty has had it’s own dependency injection (aka IOC) XML configuration format, which we often refer to as jetty.xml format. This is essentially equivalent to the more popular IOC frameworks like spring XML and Jetty has also been able to be configured and run with spring. However that approach did not allow the context.xml and jetty-env.xml files to be written in spring format, so deployments still had a mix of IOC formats. With Jetty 7.4, the jetty XML configuration format can now detect other formats and will use the java services mechanism to look for a provider for that format. The Jetty-spring module now provides a SpringConfigurationProcessor so that anywhere that a Jetty XML Syntax file is expected, a spring XML file can be used.
Jetty Reverse HTTP
There is an increasing desire to server content of client machines or to run servers from behind restrictive firewalls. An example of this is running a jetty server on an android phone, where the 3G network prevents inbound connections.
Jetty Reverse HTTP uses comet long polling techniques to allow a jetty server to make an outbound connection to a gateway, over which it will receive inbound requests.
Jetty Nested
Jetty has some compelling features, but sometimes it just is not possible to deploy Jetty. Often this is due to non technical reasons such as a corporate policy that say that only allowable container is LogicalGlassSphere or similar.
Jetty nested makes it possible to deploy jetty within another servlet container by adding a Jetty connector that takes requests/responses from the outer container and turns them into Jetty requests and responses. If permissions allow, Jetty may also open other connectors on other ports, so that as well as outer container requests, jetty can directly serve async HTTP and/or Websockets.
This allows your jetty application to be consumable by corporate policies and deployment procedures, while still giving you access to most of the feature set of Jetty. [ Currently the jetty nested connector does not support non blocking asynchronous requests, but it will eventually support that when deployed in servlet 3.0 containers. ]
Half Close support
Jetty has long used half close when sending content bounded by EOF to avoid the situation where intermediaries handle a TCP/IP RST by discarding all buffered data. But since Jetty is also frequently used in a client and/or proxy role, it has become important that half close is supported inbound as well as outbound. Jetty now supports inbound half closes without an immediate close, so that outbound data can continue to be generated and flushed. This is also integrated with SSL and Websocket closing hand shakes.
15 Comments
Franck · 08/04/2011 at 21:14
Where is the docs for the Reverse HTTP feature ?
gregw · 08/04/2011 at 21:28
Frank, there are none at the moment. But we will be working on them over the next few weeks.
Franck · 08/04/2011 at 21:35
OK, Thanks
Cem · 05/05/2011 at 13:33
Is there any document about this?
gregw · 05/05/2011 at 14:01
The documentation is coming, currently it is javadoc only, but blog entries are coming and then wiki pages.
spring blog is done, overlay blog is about ready, nested blog is next
Cem · 03/06/2011 at 11:42
Could you help me to configure jetty maven plugin in order to support reverse http. I am waiting blog post, but still we have not seen it. Maybe you can point something to at least start. 🙂
gregw · 03/06/2011 at 22:20
I’ll try to get a blog out in the next few days.
Cem · 25/06/2011 at 00:08
We are still waiting for blog post. 🙂 As I said please refer something to start at least.
Michael Chang · 20/12/2011 at 22:11
I’d just like to mention that blogs and wiki entries are not a replacement for real documentation. I understand that you want to get code out to the community as soon as possible, which is good, even if it means that the code comes before the documentation. But eventually documentation must follow, and it should be versioned, kept up-to-date, and be thorough. Example: I’m STILL trying to figure out how to deploy my WAR to Jetty and setup a virtual host. No matter what I do I always get the default test page. Google for “jetty virtual host” and the most relevant info points back to the Eclipse Jetty wiki which is not thorough enough. Seems like no one on the planet has ever set up virtual hosting in Jetty if you consider Google to be authoritative. I don’t mean to offend, I just wanted to get that off my chest.
gregw · 21/12/2011 at 00:40
Michael,
Why do you consider wiki documentation not real documentations? Do you want us to write a book? Virtual hosts configuration is explained at http://wiki.eclipse.org/Jetty/Howto/Configure_Virtual_Hosts and the standard jetty deployment also has a commented out virtual host configuration for the test webapp.
If you have having problems, then you can ask for help on the mailing lists, on IRC or open an issue to track them.
Failing that, you can purchase a support contract from http://www.webtide.com at great value and that would also help support the project so we can continue to improve the documentation.
gregw · 08/04/2011 at 21:30
I should also note that the other new feature in Jetty 7.4 is support for -06 draft of websockets
Vineet · 21/04/2011 at 18:21
How to run Jetty as a windows service? Please help
Bob Obringer · 29/04/2011 at 16:42
Are these changes going to make 8.0.0-M3?
If so… when can we expect that? The Overlay deployer is going to be a game changer for us. Greatly looking forward to it! Well done guys…
Free Trade · 29/07/2011 at 09:17
Is there any document about this? , I need the documentation about Jetty Nest
gregw · 01/08/2011 at 05:00
Only http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/nested/NestedJettyServlet.html
But there is a full example in the source code under test-jetty-nested which you can use as a base to work from.
Comments are closed.