Developing Apps in Tomcat 4.0 ============================= * Create your development directory structure. % mkdir explorer % cd explorer % mkdir docs src web web/WEB-INF docs/ - should contain your documents src/ - should have your .java files and should conform to the packages directory structure ( src/com/streamlogic/package) would be package com.streamlogic.package web/ - should have your jsp, css, html files web/WEB-INF - should have your web.xml file. This is also a good place for JSP tag libraries and other configuration stuff such as DB name and password conneciton information. * Create your .cvsignore file in the base directory (explorer/ in this case) build dist build.properties * Create explorer/build.properties # build.properties # Created by tim@streamlogic.com # Application Name app.name=explorer app.version=0.1-dev # Tomcat 4 installation directory catalina.home=/usr/local/jakarta-tomcat # Manager webapp username and password manager.username=babyduck manager.password=password manager.url=http://streamlogic:8080/manager * Copy the build.xml file from /usr/local/jakarta-tomcat/webapps/tomcat-docs/appdev/sample/build.xml % cp /usr/local/jakarta-tomcat/webapps/tomcat-docs/appdev/sample/build.xml . * Modify the build.xml file if necessary. There are comments in there for other build.properties options also. Important places to modify for ant to copy .jar files to your project for distribution purposes: * Fix the default build.xml file (bug): From: To: * All right you're all set. You now can do: # Get various ant directives % ant --projecthelp % ant clean % ant compile # Shortcut for and "ant clean" followed by an "ant compile" % ant all % ant javadoc # Create distribution directory and WAR file for production release. % ant dist # Dynamically install the app into tomcat % ant install # Dynamically remove the app from tomcat % ant remove # Dynamically reload app from tomcat % ant reload