The imported maven project, if you want to use tomcat to start, you need to convert it into a web project to start
1. Right-click properties of the project
2. Select project factets
3. Select Dynamic Web Module on the right, and select the version. Generally, if the tomcat version is high, select 3.0
4. After selection, future configuration available will appear below...
5、点击 future configuration available...
A dialog box will pop up with two columns of input, Content root and Content directory
The default Content directory is WebContent. At this time, it is determined that the WebContent related directory will be generated by default.
But in my maven project, the web related content is placed under src/main/webapp, so the Content directory is set to src/main/webapp
6. Then select Deployment Assembly under the right-click properties of the project. This item was not available before it became web.
add maven related jar package, otherwise it will report an error
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
add - > Java Bulid Path Entries - > Maven Dependencies
Relevant solution detailed links are transferred from: http://chenzhou123520.iteye.com/blog/1836987