Msn web hosting - much easier. The next section describes the steps

much easier. The next section describes the steps that you must perform to package your web application as a WAR file. 16.3.1 Creating the WAR File The first step in packaging your application as a WAR file is to create a root directory. In most cases, this directory will have the same name as your web application. For our example, we will create a directory called storefront. After deciding how your JSP and HTML pages will be placed within your application, place them underneath the root directory in their appropriate subdirectories. For the Storefront example, our directory structure so far would look like Figure 16-2. Figure 16-2. The Storefront application directory structure Figure 16-2 shows 11 subdirectories, 8 of which contain JSP pages for the application. The images directory contains images that are used globally throughout the application, the stylesheets directory stores cascading stylesheets for the application, and the include directory contains files that are included using either a static or dynamic include. The next step in setting up the WAR file is to ensure that you have a WEB-INF directory underneath your root web application directory. The WEB-INF directory contains all of the resources that are used internally by the application. For example, the TLD files for your custom tag libraries reside in this directory, as does the web deployment descriptor. This is also where the Struts configuration files belong. No resource within this directory can be made public outside of the application. Underneath the WEB-INF directory, create two subdirectories: one called classes and the other called lib. The classes directory should contain all of your utility and servlet classes. The lib directory should contain the JAR files that the application depends on. Once all of the resources for the web application are accounted for and are inside the appropriate directories, you need to use Java’s archiving tool jar to package the directories and files. From a command line, change to the root directory of your web application and use the jar utility. You need to give the file a .war extension, like this:
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply