When you install the Java EE version of the IDE, you can choose to install and register the Tomcat Web Server. You can also configure the IDE to deploy web applications to other installations of supported versions of the Tomcat Web Server. These versions need to be registered first. Unsupported versions of the Tomcat Web Server cannot be registered with the IDE. Instead, for these versions you can create Ant targets for starting and stopping the Tomcat Web Server and for the deployment of web applications, JSP pages, and servlets.
To write Ant targets to deploy to Tomcat Web Server 4:
c:/Program Files/Apache Group/Tomcat 4.1/webapps/MyWebAppProjectName
Make sure that the path above points to the Tomcat Web server's webapps folder, and replace MyWebAppProjectName with the name of your web application project.
<target name="startcat4" depends="init"> <exec executable="c:\Program Files\Apache Group\Tomcat 4.1\bin\startup.bat"> <env key="CATALINA_HOME" value="c:\Program Files\Apache Group\Tomcat 4.1"/> <env key="CATALINA_BASE" value="c:\Program Files\Apache Group\Tomcat 4.1"/> </exec> </target>
<target name="run" depends="compile"> <exec executable="C:\Program Files\mozilla.org\Mozilla\mozilla.exe"> <arg value="http://localhost:8080/MyWebAppProjectName/${client.urlPart}"/> </exec> </target>
<target name="stopcat4" depends="init"> <exec executable="c:\Program Files\Apache Group\Tomcat 4.1\bin\shutdown.bat"> <env key="CATALINA_HOME" value="c:\Program Files\Apache Group\Tomcat 4.1"/> <env key="CATALINA_BASE" value="c:\Program Files\Apache Group\Tomcat 4.1"/> </exec> </target>
To integrate the Ant targets with the IDE:
To deploy the web application:
The JSP page or servlet specified by the client.urlPart property is displayed in the browser that you defined in the Run target.