Today, Budi walks us through a refresher and brief overview of server JSP programming. Today's portion covers Servlet technologies, including servlets and Tomcat. This excerpt comes from chapter one of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983-7, 2004).
You can deploy an application to a production machine by just copying the application directory and all of its contents to that machine. Alternatively, you can package your application into a Web archive (WAR) file. A WAR file has a .war extension. A WAR file is basically a Java archive (JAR) file you create using the jar program. The WAR filename is usually the same as the application’s name, but you can use a different name if you desire.
To deploy an application packaged in a WAR file, copy the WAR file into the webapps directory. You then can access your application just as you would access an unpackaged application. The name used for your packaged application is the .war filename. For example, if you package an application called myApp into a WAR file called aWarApp.war, when deployed, the application name is aWarApp, not myApp. This is because the application name is not included in the WAR file when you package your application.
Remember: This is part one of the first chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). Stay tuned for part 2 of "Overviews of Java Web Technologies," where we learn about JSP, JavaBeans, and Model 2. Buy this book!