I\'m writing some example code where an embedded Jetty server is started. The server must load exactly one servlet, send all requests to the servlet and listen on localhost:80>
You could configure Jetty declaratively in a Spring applicationcontext.xml, e.g:
http://roopindersingh.com/2008/12/10/spring-and-jetty-integration/
then simply retrieve the server bean from the applicationcontext.xml and call start... I believe that makes it one line of code then... :)
((Server)appContext.getBean("jettyServer")).start();
It's useful for integration tests involving Jetty.