最近在看springboot实战这本书.跟着上面列子搭建 thymeleaf项目时, 书上写道 springBoot中thymeleaf内置web. 然而实际开发中却发现请求不到 @requestMapping 我看了一下jar包 果然没有 spring-boot-starter-web 这个jar包 于是在pom.xml中添加这个就解决了
附上代码
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
这个时候在 使用@requestMapping 就可以找到了.