The previous deployment structure of the Java Web Project has been blurred, and the impression always feels messy. I don't know why, take the time to summarize today.
Sometimes things are like this, seemingly complex things, think in fact very simple, and some seemingly simple, actually behind quite complex. All right, that's not a rip. Simply list the next steps:
1, it is well known that we generally deploy Web projects, are first to make the project into a war package (can be executed on idea, can also be executed with the command line)
2. Copy the war package into Tomcat's WebApps directory
3. When Tomcat is started, Tomcat will automatically help us unpack the war package. The extracted project directory looks like this:
4, the main content is under the Web-inf, look at the Web-inf directory structure:
Below the classes directory is the class file for our business code, and the resources below it (such as the spring configuration file).
The Lib directory is a third-party jar package that is dependent on our pom files.
5. We can also choose not to copy the war package when we deploy, and copy the Web-inf folder and Meta-inf directly.
6, at this time we can directly access the application on the browser (http://ip:port/appname), AppName is the name of the directory after the war package decompression.
If someone thinks I write very low, please gently drifting over, hope not to spray, this is purely personal summary of the use.
Web project Deployment