Jetty is an open source HTTP server and Servlet container that is an implementation of the Java Servlet 2.3 and JSP 1.2 specifications. Jetty is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
Since JOnAS 2.6, JOnAS provides a full J2EE application server, Jetty may be used with
JOnAS as Web container. This functionnality is set up via the JOnAS web container service.
At this time Tomcat 4.1.x and Jetty 4.2.x are supported as implementation of JOnAS web container service.
Note that in earlier versions of JOnAS a service jetty
was provided.
In the JOnAS J2EE server you will be able to run your beans inside EJB containers
via the ejb service or ear service while you will be able to run
your servlets or JSPs via the web container service or ear service.
JOnAS will be used to run your beans inside EJB containers while Jetty will
be used to run your servlets or JSPs. Inside these servlets or JSPs, you will
be allowed to access remotely beans inside the JOnAS EJBServer.
For the cases where security is needed, Jetty will be used also for user authentication. Refer to the security in Jetty for more information on how to use security with JOnAS and Jetty.
Here after are described the following steps to configure JOnAS and Jetty to make them working together.
Since JOnAS 2.6, a new JOnAS service web is provided for launching
a servlet container inside the JOnAS JVM.
At this time, two implementations of this service are provided.
jonas.services
property of jonas.properties
file and to set
the jonas.service.web.class
property of jonas.properties
file
to:
org.objectweb.jonas.web.jetty.JettyJWebContainerServiceImpl
Then you configure Jetty as usual by updating if needed the $JONAS_ROOT/config/jetty.xml
.
You can set the Jetty port with putting in the $JAVA_OPTS var, the command line : -Djetty.port=<your port number>
.
This will ovveride the property of the jetty.xml file.
For more information have a look at Jetty configuration documentation
How to use servlets and JSPs is explained in the Developing Web Components or J2EE Application Programmer's Guide chapters of the online JOnAS documentation.