J2EE Packaging for ServletsWeb Applications


J2EE Packaging for Servlets”Web Applications

J2EE 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 Hierarchy

If 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/ 
  • WEB-INF/web.xml” This is the Web application deployment descriptor. A deployment descriptor is a J2EE standard way of configuring the Web application. It contains, for example, configuration information for your servlet.

  • WEB-INF/weblogic.xml” This file contains configuration information that is specific to WebLogic Server. This includes information on how to map resources in the web.xml file to resources that exist elsewhere in the physical WebLogic Server environment.

  • WEB-INF/classes” Contains the classes that are part of the Web application. Our sample servlet will be placed under this directory.

  • WEB-INF/lib” Contains jar files and any other needed libraries for this Web application. For this first servlet the lib directory will not be used.

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.




BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net