1.如果不需要spring mvc,删除相关dependency即可。
2.Idea->pom.xml
<!-- 以下为创建java spring mvc restful风格使用的jar包 --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.2.2.RELEASE</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2</version> <scope>provided</scope> </dependency> <!-- 以上为创建java spring mvc restful风格使用的jar包 -->
来源:https://www.cnblogs.com/majestyking/p/12578459.html