Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. This guide describes how to integrate JOnAS with Tomcat from Apache.
Since JOnAS 2.6 provides a full J2EE application server, Tomcat 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 tomcat
was provided with two implementations one for Tomcat 3.3.x and one for Tomcat4.0.x.
This service tomcat is now deprecated because
it was not compliant to J2EE specification.
So now, Tomcat 3.3.x is no more supported with JOnAS (except through the deprecated servicetomcat) .
For the cases where security is needed, Tomcat will be used also for user authentication. Refer to the security guide for more information on how to use security with JOnAS and Tomcat.
Here after are described the following steps to configure JOnAS and Tomcat 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.catalina41.CatalinaJWebContainerServiceImpl
(It is the default value)
Then you configure Tomcat as usual by updating if needed the $CATALINA_HOME/conf/server.xml
or the
$CATALINA_BASE/conf/server.xml
.
Configure Tomcat with a JOnAS realm. Check the security HowTo.
If you want to customize a web application that will be deployed by the web container service or the ear service you can do this in the server.xml
file
by setting a <Context/> element with attribute className set to org.objectweb.jonas.web.catalina41.JOnASStandardContext
You can found a server.xml example in JONAS_ROOT/conf/server.xml
Of course this is only a subset of what is possible to configure in Tomcat. For more information have a look at Tomcat 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.