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.

Jetty 7.4 new features

15 thoughts on “Jetty 7.4 new features

  • April 8, 2011 at 9:14 pm
    Permalink

    Where is the docs for the Reverse HTTP feature ?

    • April 8, 2011 at 9:28 pm
      Permalink

      Frank, there are none at the moment. But we will be working on them over the next few weeks.

      • April 8, 2011 at 9:35 pm
        Permalink

        OK, Thanks

      • May 5, 2011 at 1:33 pm
        Permalink

        Is there any document about this?

        • May 5, 2011 at 2:01 pm
          Permalink

          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

          • June 3, 2011 at 11:42 am
            Permalink

            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. 🙂

          • June 3, 2011 at 10:20 pm
            Permalink

            I’ll try to get a blog out in the next few days.

          • June 25, 2011 at 12:08 am
            Permalink

            We are still waiting for blog post. 🙂 As I said please refer something to start at least.

          • December 20, 2011 at 10:11 pm
            Permalink

            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.

          • December 21, 2011 at 12:40 am
            Permalink

            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.

  • April 8, 2011 at 9:30 pm
    Permalink

    I should also note that the other new feature in Jetty 7.4 is support for -06 draft of websockets

  • April 21, 2011 at 6:21 pm
    Permalink

    How to run Jetty as a windows service? Please help

  • April 29, 2011 at 4:42 pm
    Permalink

    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…

  • July 29, 2011 at 9:17 am
    Permalink

    Is there any document about this? , I need the documentation about Jetty Nest

Comments are closed.