Installing the sample application
Tomcat comes with one main sample application. This certainly isn't sufficient to test your specific application needs, but it will provide a functional test of a basic JSP application and basic servlet.
When you pull up the Tomcat Web Application Manager to deploy your application, you need to know which directory to look in to select the Web Archive (WAR) for deployment. Use the code in Listing 11 to find this file.
Listing 11. Find your WAR file for deployment
bash-3.00# cd $CATALINA_HOME bash-3.00# find . -name *.war ./webapps/docs/appdev/sample/sample.war ./webapps/sample.war
Under Manager Application, scroll down to the Deploy section, shown in Figure 5.
Figure 5. Sample application deployment
Under War file to deploy, simply click Browse. Select the sample application WAR using the path you found above. Click Open, and then click Deploy. Really, it's as simple as that to deploy the sample application.
After you've deployed the application, you can see whether it came up by going to http://localhost:8080/sample/. Here, you can click JSP, and then click Servlet to verify that these come up and that basic application functionality is there, as shown in Figure 6. The server should now be ready for your application.
Figure 6. Sample application test and verification page
As you can tell, this is just a verification that your Tomcat server was installed correctly and is functioning as intended. To deploy your personal application, you must follow J2EE guidelines regarding packaging and installing under certain "context roots" under the Tomcat server directory.