1. Key points: you only need to set the webroot directory and Java sourceProgramClass files can be packaged.
The directory structure after packaging is -- |
| ------ META-INF
-- | ---- | -- WEB-INF
| ----- Lib
| ----- Class
| ----- Web. xml
| -----. Jsp
2. Copy these files to a separate folder, such as the project folder, according to the preceding directory format.
Find the project directory in DOS and run the command: D:/Project> jar-CVF/D: A. War *
Note: D:/Project> is the directory that contains all files and folders;
/D: A. jar is the name of the JAR file to be generated. jar and the directory to be stored. You can set/d by yourself:
Stored in disk D.
* It means to compress all the files in the project directory, and the contents of the compressed jar files
The record structure is the same as the original one.
3. Put the jar package in the Directory D:/tomcat-6.0.13/webapps under tomcat, that is, webapps.
Start Tomcat and enter http: // localhost: 8080/A/**. jsp in the address bar.
Note: The name of the jar package A. Jar should be the same as the name of your project, because it may be
Items are used for page Jump.
Target path. If the jar package name is different from the project name, an error may occur. The display page cannot be found.