I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

Jetty: Rising Star of Server-Side Java?

04.14.2008
| 13239 views |
  • submit to reddit

Light and fast seems to be a recipe for success for Jetty these days, giving new life to server side applications in Java. As more and more developers realize they don't need the heavyweight app servers of old, interest in a reliable, free, lightweight "get the job done" Java servers is likely to increase.

So it seems with Jetty, a sometimes overlooked workhorse of Java. Pound for pound you get a lot of power out of Jetty, and its svelte profile may be just what you're looking for.The embeddability and scalability of Jetty seems to have really helped it take off as the embedded server of choice amoung Java tools. According to this article it has reached 12th place among all server implementations in the latest Netcraft Web Server Survey.

The adoption of Jetty should come as no surprise. Looking at the list of "Jetty Powered" applications, you see big names like Eclipse, Spring and JIRA all using Jetty to some degree. There's even a version of Jetty ported over to Google's Android.  Perhaps the use of Jetty in Eclipse is most interesting, where the component based architecture enabled Jetty to move into OSGi. As pointed out in the Webtide blog:

As Jetty's architecture has always been component-based and highly embeddable, moving Jetty into OSGi was something of a natural fit. A while ago, we were contacted by the Eclipse guys to tell us that they'd integrated Jetty into Eclipse's OSGi container - called Equinox - as the Http service.

These uses of Jetty are intruiging, and with current trend of bridging the gap between traditional desktop applications and hosted web applications, it can only continue to grow.

What are your thoughts on Jetty, and how have you used it in your own Java applications?

Comments

Kenneth Lewelling replied on Mon, 2008/04/14 - 11:14am

While I have never used Jetty in production I find the jetty maven plugin to be fantastic for development. Make a change and jetty restarts, really cuts down on the write, compile, deploy cycle.

Another great tool that can be embedded with jetty is OpenEJB (just released 3.0 final). If anyone is interested here is a link that explains how:

Jetty + OpenEJB

This combination is great if you have to use EJBs and don't like waiting while redeploying to larger slower app servers. 

Kenneth

 

darryl west replied on Mon, 2008/04/14 - 11:54am

jetty is great for development and production. we started using jetty (6) a few years ago for development and beta installations. we now have our first production installation using jetty and are quite pleased.

Mike P(Okidoky) replied on Mon, 2008/04/14 - 4:41pm

I've used Jetty a number of times. I've embedded it into my home brewed Java server and I've used to a few times embedded in a few work projects.

The code is nice, the way it embeds is great, it configures well, error handling is good.  It performs very well and it's robust and predictable. It's very under-rated. I've often wondered how Tomcat (and a lot of other Apache components) got to walk away with their grand master overlord status, while clearly, there were and are better components out there...

 

Rob Williams replied on Mon, 2008/04/14 - 10:06pm

Looks like Jetty 6 is out and has continuations. Kind of questionable that they implemented the suspend through an exception, wonder how that performs. But continuations are a great idea. The servlet spec had almost nothing in it and what was there was done wrong, and worse yet, didn't provide an interface that would allow other implementers to fix it. 

Not sure where they are with WTP/Eclipse integration. 

Michael O'Keeffe replied on Tue, 2008/04/15 - 10:06pm

Definitely agree.  A good example is Cruise Control - it runs on Jetty by default.  No messy config, futzing with XML, it just works!  You get to spend your time on what you're really interested in which is running the app, Cruise Control.  Jetty is there, quietly behind the scenes, making it all happen - nice.

Gregory Pierce replied on Sun, 2008/04/20 - 2:57pm

Always been a huge fan of Jetty. I originally built it into a production workflow engine while other people were still trying to futz around with getting Tomcat's XML configuration set up properly. Jetty was always a joy to embed into pretty much anything you wanted to embed it into and its performance was always above par. The project has always been under-appreciated by the mass of Java developers AND hosting companies.

 Hopefully this move for Jetty will lead to its widespread adoption and acceptance in more circles. It certainly deserves it.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.