J2EE Packaging for Servlets”Web ApplicationsJ2EE defines a standardized structure in which to deploy servlets; JavaServer Pages (covered in the next chapter); static content, such as images and static HTML pages; and any libraries that are needed to use these components . Web applications, or Webapps, can be packaged in either an exploded directory structure (that is, a normal directory structure with files and subdirectories), or in a war (Web archive) file. A war file is a Java jar file that contains a particular directory structure”the same one as the exploded directory. Web Application HierarchyIf you have a Web Application named myFirstWebApp, the directory structure would start out with a top-level directory named the same”myFirstWebApp. The directory structure would then look like this: myFirstWebApp/
Caution Directory and file names are case sensitive. On a case-insensitive platform such as Windows your application will run if you have an incorrectly named directory or file. However, on a system with a case-sensitive file system such as Unix, the same application will not work. For portability always ensure that you have the correct case. |