1.4 package and release the servlets and jsp programs
Create a directory structure first. Then you can use the jar tool or Ant to create a War file.
/Mywebapp
/Images
WEB-INF
/Classes
/Lib
A servlet specification specifies to contain a WEB-INF directory where two subdirectories classer and lib directory WEB-INF contain a deployment description file for a web application. It is called web. xml. Jsp AND htm files will be placed under/mywebapp.
Servlets and javaBeans will be placed under the classes directory.
For example: com. mydev. MyServlet, this servlet class must be under the WEB-INF/classes/com/myorg/MyServlet. class.
The Lib folder contains some other jar packages required by the web application. For example, log4j. jar, database connection driver, and jstl
And so on .....
· Enter the root directory: jar cvf mywebapp. war. Do not forget the last point (.)
· Unpackage command: jar tvf xxxx. war