spring boot controller路由 url 扫描不到问题
2016-10-09 09:41
477 查看
spring boot项目出现controller的路由没被注册,
原因:启动类application跟controller不在一个包中,扫描不到controller,
如启动类在com.oyx.a,controller在com.oyx.b 解决办法:
方法1:将controller跟启动类放在一个包中,或者在启动类所在包的子包中
方法2:在启动类上添加注解 @ComponentScan("包名")
原因:启动类application跟controller不在一个包中,扫描不到controller,
如启动类在com.oyx.a,controller在com.oyx.b 解决办法:
方法1:将controller跟启动类放在一个包中,或者在启动类所在包的子包中
方法2:在启动类上添加注解 @ComponentScan("包名")
相关文章推荐
- spring boot controller路由 url 扫描不到问题
- spring boot controller路由 url 扫描不到问题
- 在idea里使用SpringBoot整合MyBatis时遇到的Mapper扫描不到的问题
- spring boot 自定义controller不能扫描到的问题
- Spring Boot 扫描不到Controller
- Spring boot扫描不到controller注解
- SpringBoot整合Mybatis扫描不到Mapper的问题
- springboot整合Mybatis扫描不到mapper问题
- spring boot 扫描不到controller
- SpringBoot集成Mybatis时无法扫描Mapper问题
- spring-boot上传文件MultiPartFile获取不到文件问题解决
- springmvc+mybatis+maven项目集成的时候遇到一个问题,项目搭起来以后,http请求怎么都进不到controller中,页面直接返回404错误,控制台没有报任何错误,请大神帮我看看
- springboot启动没报错但是访问不到url
- springboot Configuration 获取不到@value配置问题
- Spring扫描不到Progurd混淆的jar包问题解决
- springboot项目访问不到controller方法。
- SpringBoot 扫描不到注解
- spring boot 自定义Controller,不能被扫描
- springboot配置文件加载不到的问题
- springboot demo写好之后再去写一个controller,怎么也访问不到页面