Jsp&Servelet study notes (4)
Author:Eve Cole
Update Time:2009-07-02 17:15:05
1.4 Package and release servlets and jsp programs
First create a directory structure. Then you can use the jar tool or Ant to create a War file.
/mywebapp
/images
/WEB-INF
/classes
/lib
A servlet specification specifies a WEB-INF directory, under which there are two subdirectories, class and lib directories. WEB-INF contains a deployment descriptor file for a web application. It's called web.xml. The jsp and htm files will be placed under /mywebapp.
Servlets and JavaBeans will be placed in the classes directory.
For example: com.mydev.MyServlet, this servlet class must be under WEB-INF/classes/com/myorg/MyServlet.class.
The Lib folder will contain other required jar packages for the web application. For example, log4j.jar, database connection driver, jstl
etc…..
·Enter the root directory: jar cvf mywebapp.war. Don’t forget the last point (.)
·Unpacking command: jar tvf xxxx.war
http://blog.csdn.net/bruceleey/archive/2007/02/07/1503848.aspx