spring boot启动后自动停止
解决方法:pom.xm中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
启动错误(一)
Error creating bean with name 'requestMappingHandlerMapping' defined in class path
原因:controller方法中有路径重复
找不到页面
解决:看看控制器 有没有添加@Controller注解。如果没添加则无法匹配页面。
数据返回时产生错误
错误:javax.servlet.ServletException: Circular view path…
原因:大致的意思是没有指定视图结果。
解决:如果不想把返回的数据展示在页面,则需要把@Controller注解换成@RestController注解。