Jetty

 
 
Jetty is a 100% Java HTTP Server and Servlet Container. This means that you do not need to configure and run a seperate web server (like Apache) in order to use java, servlets and JSPs to generate dynamic content. Jetty is a fully featured web server for static and dynamic content.

What is the difference between Jetty and Tomcat? Jetty and Tomcat offers the same fuctionality, they both provide implementations of the same API. Tomcat is developed to provide a standard reference implementation of a J2EE-compliant web-container. Jetty's mission is to deliver this behaviour as fast, lightweight, and tightly integrated with JBoss.

Jetty is released under an Open Source License, derived from the Artistic License. The License puts few restrictions on usage of Jetty, which is free for commercial use and distribution.

More information about Jetty can be found at: http://jetty.mortbay.org

You can download and install Jetty from http://jetty.mortbay.org, however I prefer using JBoss with Jetty integrated.







Installing Jetty 4.1 with JBoss 3.0.4



Information
Jetty 4.1 supports Servlet 2.3, JSP 1.2 and HTTP/1.0 and HTTP/1.1 protocols.

Operating system used
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites
none

Procedure
  1. Install JBoss (jboss-3.0.4.zip). This JBoss zip file contains Jetty 4.1.

  2. Jetty should deploy from:
    ..\jboss-3.0.4\server\{default | all}\deploy\jbossweb.sar
    Note 1: Choose directory default or all depending on how you have started JBoss.
    Note 2: sar = jboss Service ARchive

  3. Jetty can be configured by files:
    • jboss-service.xml - JBoss server configuration file
    • webdefault.xml - default descriptor for web applications
    These files can be found at:
    ..\jboss-3.0.4\server\{default | all}\deploy\jbossweb.sar\META-INF\jboss-service.xml
    ..\jboss-3.0.4\server\{default | all}\deploy\jbossweb.sar\webdefault.xml


  4. To deploy an EAR or WAR file, containing your web application, drop the file in the deploy directory:
    ..\jboss-3.0.4\server\{default | all}\deploy\

  5. The configuration "out-of-the-box" does not have a web application running in the so called "root context". This means that you will get an error 404 when you try to access http://localhost:8080. This is NOT a problem with your installation. If you want to see something you must create a web application (WAR or EAR file) and deploy it.