Packaging Web Applications

All Web components are packaged together into a standard file, a Web Archive (WAR) file, which can be deployed into the Web container. A WAR file is a type of JAR file that can be created using the jar utility. It contains both server-side classes, such as servlets, JavaBeans, JSP, and taglibs, and client-side contents, such as applets, HTML, and images. The directory structure of a WAR file looks like Figure 7.2 illustrated earlier today.

When creating a WAR file, arrange the directory according to the structure in Figure 7.2, and then issue the jar command from the application's home directory:

						jar -cvf  mywebapp.war *
					

The web.xml file is the standard Web deployment descriptor, and weblogic.xml is the vendor-specific ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.