In fact, the war file is the packaging of Web applications in Java. To borrow a man's words, "When you have a lot of web apps, if you want to deploy it to another machine, it's a pretty depressing thing to back up the files, if only a file ... Then the war file can satisfy your little request. "
That someone would say, this and directly into a RAR file is not the same. The difference is big.
If you directly into a RAR file, you have to manually decompression, but the war file does not need, you put it in Tomcat's WebApp directory, you can run directly, I think this work can be strong, haha.
Under the Tomcat installation directory under the Conf directory has a server.xml, search "unpackwars" keyword, you will see in the label will have its settings, if set to true, then tomcat in the boot, Automatically unzip your war file in the WebApps directory, and if set to False, Tomcat accesses the war file directly.
If his value is true, your tomcat has been activated, you delete the Automatically unzipped folder, Tomcat will automatically decompress, I think it is real-time in the check, once no, will be decompressed.
How do I generate a war file:
JAR-CVF Blog.war *
How to view the war file:
JAR-TF Blog.war