Circular view path [h]: would dispatch back to the current handler URL [/h] again

1、错误描述

(1)在书写一个SpringBoot的项目的时候出现如下错误

 

 

 (2)程序实现

Controller的注解是:

@Controller

访问的Controller的方法是:

  @RequestMapping("h")
    public void nihao(){
       System.out.println("nihao");
  }

 

2、解决方式

将注解改为:

@RestController

即可正常运行

 

posted @ 2020-11-18 18:56  怀梦想,致远方  阅读(2880)  评论(1编辑  收藏  举报