31.6. Compiling your Web Application

With Ant (http://jakarta.apache.org/ant/) you can compile the Web applications that you will find under $JONAS_ROOT/examples. You have to run build install to compile examples and install the .war file in tomcat.

If you use gnu make, you just have to run:

You can also run compilers manually via compile.sh or compile.bat.

Looking at the alarm example, the following steps are performed run rebuild all on the web application:

  1. Run make install in the bean directory to build the alarm.jar file and install it in $JONAS_ROOT/ejbjars

  2. Create in output/webapps an alarm directory that will be used to build the alarm.war file that will be installed in $TOMCAT_HOME/webapps ($CATALINA_HOME/webapps)

  3. Copy $JONAS_ROOT/ejbjars/alarm.jar to output/webapps/alarm/WEB-INF/lib. This is the way servlets or JSPs will see the bean classes. Another possibility would be to make this classes accessible by the classpath.

  4. Copy etc/web.xml to output/webapps/alarm/WEB-INF

  5. Copy all files under the web directory in output/webapps/alarm

  6. Make a .war file that has all the directory hierarchy under output/webapps/alarm

Install the application by copying alarm.war to $TOMCAT_HOME/webapps ($CATALINA_HOME/webapps) and copying apps-alarm.xml to $TOMCAT_HOME/conf (for Tomcat 4.0.x, apps-alarm.xml is not used).