1. Create javaweb project under idea
new---->project
First create a normal java project
Right click on the project and select Add Framework Support
Choose JavaEE
Select Web Application and check Create web.xml, click OK, and our javaweb project is created.
At this point we can see that it is different from ordinary java projects, and there is one more web folder
2. Publish the project to Tomcat
**First we have to modify the contents of the index.jsp file under the following web folder. Reason 1: Because this file is the home page. Reason 2: It is easy to check whether our project has been released successfully (I wrote in the idex.jsp file that I am a project released by idea
)
Click Add Configuration, click the + sign
Then click deployment and the + sign
click on artificail
Click apply
After clicking ok, our project has been released here, and it is now running
If successful, the content we just typed will be displayed in the browser.
At the same time, we can also view the project we just released in tomcat