IntelliJ IDEA creates simple web projects (with pictures)

Intellij IDEA creates a web project and deploys it in Tomcat

1. Create a web project

1. File -> New Module, enter the create project window

  

 

2. Select the Java type, enter the project name at Module name, and click Next  

3. Check Web Application, check the Create web.xml option, and click Finish

  

4. Right-click in the WEB-INF directory of the project, New -> Directory, create two directories, classes and lib   

5.File -> Project Structure (Ctrl + Shift + Alt + S), enter the Project Structure window   

6. Click Modules -> Paths, check "Use module compile output path", and change both "Output path" and "Test Output path" to the classes directory created before  

7. Click Modules -> Dependencies, click "+" -> "Jars or directories" 

8. Select the lib directory created before -> "jar directory" -> OK -> Apply -> OK   2. Configure Tomcat

1. Run -> Edit Configurations, enter the "Run Configurations" window  

2. Click "+" -> Tomcat Server -> Local to create a new Tomcat container 

3. Enter a new service name in "Name", click "Configure..." behind "Application server", the Tomcat Server window will pop up, 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 -> OK, so far the Tomcat configuration is complete.  3. Deploy and run the project in Tomcat 

1. Run -> Edit Configurations, enter the "Run Configurations" window   2. Select the previously configured Tomcat, click the "Deployment" tab, click "+"->"Artifact"-> Select the created web project 

3. Modify "Application context" -> Apply -> OK   4. Run Tomcat and view the results in the browser  

Original address: http://www.thinksaas.cn/topics/0/350/350000.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326972243&siteId=291194637