Intellij idea Create Web project and deploy in Tomcat run
I. Creating a Web Project
1, File--New Module, enter the Create Project window
2. Select the Java type, enter the project name in the Module name, click Next
3. Tick the WEB application, tick the Create XML option, click Finish
4. Right-click on the project's Web-inf directory, New directory, create classes and lib two directories
Project Structure 5.File (Ctrl + Shift + Alt + S), go to Project Structure window
6. Click Modules-Paths, tick "Use module compile output path" to change "Output path" and "Test output path" to the classes directory created previously
7. Click Modules-Dependencies, click "+", "Jars or directories"
8. Select the previously created Lib directory, "jar directory", OK, Apply, OK
Two. Configure Tomcat
1, run, Edit configurations, go to "Run Configurations" window
2. Click "+"--tomcat Server---Local, create a new Tomcat container
3. Enter a new service name at "name" and click "Configure ..." after "Application Server" to eject the Tomcat Server window and select the locally installed Tomcat directory, OK 5. In the "Run Configurations window, in the Server palette, uncheck "After launch", set "HTTP port" and "JMX port", click Apply--and OK, and the Tomcat configuration is complete. Three. Deploy and run the project in Tomcat
1.Run, Edit configurations, go to "Run Configurations" Window 2. Select the previously configured Tomcat, click on the "Deployment" tab, click "+", "Artifact"- > select the Web project you created
3. Modify "Application Context", Apply---OK 4. Run Tomcat to view the results of the run in the browser
Intellij idea Create Web project and deploy in Tomcat run