在运行SpringBoot时报了这样一个错误

百度翻译是视图循环

搜索一下 原来是类上restcontroller写成了controller 
对比一下两者

@Controller和@RestController的区别?

官方文档:
@RestController is a stereotype annotation that combines @ResponseBody and @Controller.
意思是:
@RestController注解相当于@ResponseBody + @Controller合在一起的作用。

1)如果只是使用@RestController注解Controller,则Controller中的方法无法返回jsp页面,配置的视图解析器InternalResourceViewResolver不起作用,返回的内容就是Return 里的内容。

例如:本来应该到success.jsp页面的,则其显示success.

2)如果需要返回到指定页面,则需要用 @Controller配合视图解析器InternalResourceViewResolver才行。
3)如果需要返回JSON,XML或自定义mediaType内容到页面,则需要在对应的方法上加上@ResponseBody注解。

然后把controller 修改成restcontroller 后成功返回页面

SpringBoot Circular view path错误的更多相关文章

  1. SpringBoot 报错: Circular view path [readingList] 解决办法

    spring boot报错: Circular view path [readingList]: would dispatch back to the current handler URL [/re ...

  2. 如何在Spring MVC Test中避免”Circular view path” 异常

    1. 问题的现象 比如在webConfig中定义了一个viewResolver public class WebConfig extends WebMvcConfigurerAdapter { //配 ...

  3. Circular view path [home]: would dispatch back to the current handler URL [/home] again. Check your ViewResolver setup!

    Circular view path [home]: would dispatch back to the current handler URL [/home] again. Check your ...

  4. 如何在Spring MVC Test中避免”Circular view path” 异常(转)

    文章转自http://www.cnblogs.com/chry/p/6240965.html 1. 问题的现象 比如在webConfig中定义了一个viewResolver public class ...

  5. Circular view path [mydemo]: would dispatch back to the current handler URL [/mydemo] again. Check your ViewResolver setup!

    简单创建一个springboot工程 pom.xml <?xml version="1.0" encoding="UTF-8"?><proje ...

  6. Circular view path xxx would dispatch back to the current handler URL,Check your ViewResolver setup

    Circular view path xxx would dispatch back to the current handler URL 通过原因分析,造成问题有两个因素:1). 缺省转发, 2). ...

  7. Spring Boot项目Circular view path问题解决

    使用Spring Boot创建Spring MVC项目,访问url请求出现问题:Circular view path 1.问题描述 控制台打印: javax.servlet.ServletExcept ...

  8. javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/pay/index] again. Check your ViewResolver setup!

    2019-08-08 17:12:03.544 ERROR 13748 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Se ...

  9. web项目——javax.servlet.ServletException: Circular view path [registerForm]

    报错: 控制台输出: 三月 21, 2019 10:12:32 上午 org.springframework.web.servlet.PageNotFound noHandlerFound 警告: N ...

  10. mock测试出现Circular view path [trade_records]: would dispatch back to the current handler URL

    这是因为你的Controller中返回的视图名称与你当前的requestMapping名称一样,这并没有很好的解决方案,除非你改掉其中一个名字. 因为springframework test时你并没有 ...

随机推荐

  1. python paramiko通过远程操作linux

    python-paramiko通过远程操作linux 1. python-paramiko通过远程操作linux python3 远程操作linux 使用第三方paramiko库,对于实现运维自动部署 ...

  2. git 拉取github项目失败(超时)

    问题 通过git拉取GitHub上的项目失败报错信息如下 fetch-pack: unexpected disconnect while reading sideband packet fatal: ...

  3. 1月3日内容总结——bbs项目登陆页面和主页、个人站点页的搭建

    目录 一.登陆功能完善 验证码功能实现 单机验证码实现验证码刷新(局部刷新) 点击登陆提交数据进行校验 二.主页搭建 html代码 views.py代码 主页内容部分 后台添加数据 分页器 前端获取头 ...

  4. 11月25日内容总结——sql查询关键字

    目录 一.SQL语句查询关键字 二.前期数据准备 三.编写SQL语句的小技巧 四.查询关键字之where筛选 1.查询id大于等于3小于等于6的数据 2.查询薪资是20000或者18000或者1700 ...

  5. 大佬们的博客 && 友链

    博客 1.https://wiki.kimleo.net/ 查组合子查到的,活化石级别 2.https://tech.meituan.com/ 美团博客,查函数式查到的,我还看过一篇讲aop的非常经典 ...

  6. Spring6 DI 依赖注入--Bean属性赋值

    Spring6基于XML实现Bean 管理(属性赋值) IOC和DI有什么区别:DI是IOC中的具体实现,DI表示依赖注入或注入属性,注入属性要在创建对象的基础之上完成 依赖注入方法 bean属性赋值 ...

  7. 对List集合进行分页

    1 简要说明 有时候,我们有一个list集合,需要对它进行分页处理 下面的根据类MyPageUtilVo就可以做到 它自带泛型,适合各种集合 可以设置每页的大小(默认为10) 根据页码(从1开始)就可 ...

  8. Python接口自动化测试(1)

    接口自动化测试三部曲:1.构造请求  2.判断结果  3.数据库查询 1.Python的第三方包:requests 简介:requests可以用来做接口测试.接口自动化测试.爬虫等 requests的 ...

  9. 编译报错,提示:This dependency was not found:* vue-editor-bridge

    前端代码引入了: 1 import func from 'vue-editor-bridge'; 工具自动填充,导致引入上述JS去掉重新编译,问题解决

  10. vue3+element表格数据导出

    实现效果 导出后的效果: 步骤 第一步:安装依赖 npm install --save xlsx file-saver 第二步:给表格添加id,导出的时候需要用到 <!-- 导出按钮 --> ...