您的位置:首页 > 编程语言 > Java开发

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);

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: