SpringBoot Controller找不到视图路径
2017-10-21 17:40
417 查看
由于版本差异,用SpringBoot 1.4.X以上版本开发时找不到@Controller定义的URL,于是在启动类加注解@ComponentScan("com.controller")即可,括号里表示Controller所在包名。
@SpringBootApplication
@ComponentScan("com.controller")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@SpringBootApplication
@ComponentScan("com.controller")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
相关文章推荐
- SpringBoot Controller找不到视图路径
- Spring Boot的被@SpringBootApplication注解的App.java必须放在所有的RestController的根路径的package下
- spring boot controller注入提示找不到业务层类
- SpringBoot项目打包后,找不到文件路径问题,处理方法
- SpringBoot系列<四>视图解析、路径-资源映射、静态资源访问
- SpringBoot项目打包后,找不到文件路径问题,处理方法
- Spring Boot Controller
- Spring Boot项目访问controller方法报404
- springboot、springcloud之静态资源路径的配置
- 关于spring boot使用velocity作为视图层模板
- springBoot @RestController @Controller
- spring boot页面路径解析和请求解析
- springboot的restcontroller
- spring boot controller路由 url 扫描不到问题
- SpringBoot velocity 模板配置绝对路径的资源路径
- SpringBoot配置非含main类的Controller的注解
- Spring mvc ContentNegotiatingViewResolver 根据路径后缀,选择不同视图
- spring boot之本地图片不能加载(图片路径)的问题
- SpringBoot Controller
- Springboot整合shiro 路径问题