在运行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. RISC-V 平台移植 RTOS

        ARM 上移植实时操作系统大家可能比较熟悉,且例程较多,对于 RISC-V 内核的 MCU,可能相对比较陌生.下面结合 WCH 的 CH32V103 和 CH32V307 两款芯片来详细说下针 ...

  2. TypeScript 学习笔记 — 函数中的类型(四)

    目录 函数的两种声明方式 可选参数 默认参数 剩余参数 函数的重载 this 的类型 对于函数主要关心的是:函数的入参类型 和 函数的返回值类型 函数的两种声明方式 通过 function 关键字来进 ...

  3. 9月23日内容总结——pycharm的安装与使用、python语法规范与注释、变量和常量、索引取值以及部分数据类型简介

    今日内容总结 目录 今日内容总结 一.pycharm的安装 1.软件介绍 2.正版安装 1.下载软件 2.安装软件 3.其他方法安装(需要先下载相关资源) ①无限试用法 ②傻瓜式激活法 ③淘宝购买 二 ...

  4. Maven配置 阿里云镜像地址

    <?xml version="1.0" encoding="UTF-8"?> <settings> <mirrors> &l ...

  5. redis-04配置文件

    1.daemonize no # By default Redis does not run as a daemon. Use 'yes' if youneed it.# Note that Redi ...

  6. spring源码写注释

    转:https://blog.csdn.net/z_c8819/article/details/105258015 1.从GitHub上下载spring项目 https://github.com/sp ...

  7. P11_组件-button和image组件的基本用法

    其它常用组件 button 按钮组件 功能比 HTML 中的 button 按钮丰富 通过 open-type 属性可以调用微信提供的各种功能(客服.转发.获取用户授权.获取用户信息等) image ...

  8. 简要介绍WASAPI播放音频的方法

    正文 填一下之前挖的坑,这回就说说怎么用WASAPI播放声音吧. 本文完整代码可以在以下链接找到 https://gitcode.net/PeaZomboss/learnaudios 目录是demo/ ...

  9. session实现servlet数据共享

    为了满足老师考试要求,要实现数据共享,要实现顾客登录的功能,登录后进行增删改查要对该顾客进行操作,所以需要将该顾客的一些信息共享给其他操作,找了一些资料,来通过session实现: 首先,设置: Ht ...

  10. GPT接入飞书

    GPT接入飞书 在体验ChatGPT这方面,我算是晚的.使用下来,更多的是对于这种应用形式感到兴奋,而不是ChatGPT的专业能力. 得知OpenAI提供GPT3的Api接口后,我想到了将其接入团队飞 ...