在运行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. Java堆外缓存(一个很有意思的应用)

    我们在开发过程中会遇到这样的场景:就是一个服务的各项 JVM 的配置都比较合理的情况下,它的 GC 情况还是不容乐观.分析之后发现有 2 个对象特别巨大,占了总存活堆内存的 90%以上.其中第 1 大 ...

  2. C++ 从数组中拿值,每个值不相同

    代码和思路 原理就是生成0,n个索引,每个索引不相同即可. 索引再到数组拿数据就行 #include <iostream> #include <vector> #include ...

  3. SpringBoot 2.x 在Tomcat8上无法运行,报无法访问错误

    非法访问:此Web应用程序实例已停止.无法加载[].为了调试以及终止导致非法访问的 这仅是我的一个Filter重写的时候没有重写他的其他两个方法,导致我在Tomcat8上不能运行,但在Tomcat9上 ...

  4. mysql16 sql优化-order by-GROUP BY

    1.简要说明   在sql中常常用到order by,排序对于sql的查询速度有较大的的影响.mysql支持两种排序方式,FileSort和Index,Index效率高,它指MySQL扫描索引本身完成 ...

  5. NETAPP 设备 C模式开关机顺序

    设备正常开关机顺序开机顺序: 1.开启所有磁盘柜的电源,大概20秒后再开启存储控制器: 2.开启接有FAS2750存储的以太网交换机或者光纤交换机: 3.开启有挂载FAS2750存储空间的服务器或者磁 ...

  6. 微信小程序数字转中文wxs

    场景: 传入数字,转换成天数,比如:index = 1 转换后则为 一,在页面中的应用就是<view>第{{index}}天</view>,转为第几天. <view> ...

  7. 数字列表number,目标值target,找到number中两个不同数字之和等于target的数字,输出下标并顺序排列 ----笔试题记录扩展

    一.思路: 输入:数字列表number,目标值target 判断条件:数字列表中两个不同数字相加等于target 输出:符合条件的两个数字的下标,下标顺序排列 方法1: def list(number ...

  8. JZOJ 6801. NOIP2020.9.19模拟patrick

    题目大意 动态维护数列中大于等于某个数的极长连续段的个数. 思路 我们考虑每段的开头,记为 \(i\),高度为 \(a_i\) 那么此时水淹的高度必然满足 \(a_{i-1} < x \leq ...

  9. CCRD_TOC_2008年第2期

    中信国健临床通讯 2008年第2期 目 录   类风湿关节炎 1. 纵向分析TEMPO数据:放射学损伤程度和进展速率决定了关节物理功能 van der Heijde D, et al. Ann Rhe ...

  10. 我做的FFmpeg开源C#封装库Sdcb.FFmpeg

    我做的FFmpeg开源C#封装库Sdcb.FFmpeg 写在前面: 该主题为2022年12月份.NET Conf China 2022我的主题,项目地址:https://github.com/sdcb ...