1.右键项目,选择Project Facets,点击Convert to faceted from 
2.勾上Dynamic Web Module
3.点击下面的Further configuration available…,弹出Modify Faceted Project窗口 
此处是设置web.xml文件的路径,输入src/main/webapp. 
Generate web.xml deployment descriptor自动生成web.xml文件,可不选. 

4.点击OK