Tuesday, 26 November 2013

extract war file using terminal

WAR file ( Web application ARchive) is a JAR file used to distribute a collection of JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages and other application resources that together create a web application.

The /WEB-INF directory in the WAR file contains web.xml which defines the structure of the web application. The /WEB-INF/classes directory is on the Class Loader's class path. This is where .class files are loaded from when the web application is executing. Any JAR files placed in the /WEB-INF/lib directory will also be placed on the Class Loader's class path.

extract a war file open your terminal and type following command :-

Last login: Wed Nov 27 10:46:12 
APP-66:~Arun$ jar -xvf DisplayTag.war

And hit enter .war file extracted and inside a war folder structure created in directory where you extract. Here i am create a .war of this project Struts2 pagination while extracting DisplayTag.war following war file structure are shown :-