刷新web项目,项目->右击->Properties->Project Facets,选择Java和Dynamic Web Module。点击Apply and Close,再次运行就好了 转载于:https://www.cnblogs.com/ly-520/p/10059699.html