创建maven webapp项目,新建class时没有Servlet模板问题 在当前项目的iml文件中configuration标签下添加 <sourceRoots> <root url="file://$MODULE_DIR$/src/main/java" /> </sourceRoots> 在新建时就有Servlet模板了