E.23. Creating a .war File

Web application archives (.wars) are similar to .jars, but they contain Web applications that might include classes, beans, HTML, JSP, images, and applets.

If you have manually created the proper directory structure for a Web application, follow these steps to create your .war for deployment using the jar tool distributed with the J2SE:

1.
Navigate to the top-level directory of the application
2.
Type at the command line: jar cvf myWebApp.war

Note that you can also create a .war file by calling the .war task of the ant build tool (available from www.apache.org). A third way to create a .war file is to use the packager tool distributed with the J2EE.

Get Java™ for ColdFusion® Developers 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.