logo

War File


Show

A war (internet archive) File carries documents of an internet project. It may also have servlet, xml, jsp, image, html, css, js etc. documents.

Here, we are going to discuss what's a war record, the way to create war records, the way to install war records and the way to extract war records.

What is the War Record?

Internet archive (War) record carries all of the contents of an internet application. It reduces the time length for moving records.

Advantage of War Record

saves time: The war record combines all of the documents right into a single unit. So it takes much less time at the same time as moving records from patron to server.

How to Create a War Record?

To create a war record, you need to apply a jar device of JDK. You want to apply -c transfer of jar, to create the war record.

Go in the mission listing of your mission (outdoor the WEB-INF), then write the subsequent command:

jar -cvf projectname.war *

Here, -c is used to create a file, -v to give rise to the verbose output and -f to define the archive file name.

The * (asterisk) symbol gives the signal that all the files of this directory (including sub directory).

Deploy the War file Here’s How?

The two methods to deploy the war file are:

  1. By server console panel
  2. By manually having the war file in a particular file folder of the server.

If you are willing to deploy your war file in the apache tomcat server manually, then go to the webapps directory of apache tomcat and then paste the war file here.

Now, you can access the web project using the browser.

Note*- The war file will be extracted internally by the server

Extract the War File Manually, Here’s How?

You need to use the -X switch of the jar tool of JDK to extract the war file. Below the command to extract the war file is given:

jar -xvf projectname.war