SpringBoot Circular view path错误
在运行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错误的更多相关文章
- SpringBoot 报错: Circular view path [readingList] 解决办法
spring boot报错: Circular view path [readingList]: would dispatch back to the current handler URL [/re ...
- 如何在Spring MVC Test中避免”Circular view path” 异常
1. 问题的现象 比如在webConfig中定义了一个viewResolver public class WebConfig extends WebMvcConfigurerAdapter { //配 ...
- 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 ...
- 如何在Spring MVC Test中避免”Circular view path” 异常(转)
文章转自http://www.cnblogs.com/chry/p/6240965.html 1. 问题的现象 比如在webConfig中定义了一个viewResolver public class ...
- 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 ...
- 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). ...
- Spring Boot项目Circular view path问题解决
使用Spring Boot创建Spring MVC项目,访问url请求出现问题:Circular view path 1.问题描述 控制台打印: javax.servlet.ServletExcept ...
- 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 ...
- web项目——javax.servlet.ServletException: Circular view path [registerForm]
报错: 控制台输出: 三月 21, 2019 10:12:32 上午 org.springframework.web.servlet.PageNotFound noHandlerFound 警告: N ...
- mock测试出现Circular view path [trade_records]: would dispatch back to the current handler URL
这是因为你的Controller中返回的视图名称与你当前的requestMapping名称一样,这并没有很好的解决方案,除非你改掉其中一个名字. 因为springframework test时你并没有 ...
随机推荐
- KingbaseES libstdc++.so.6/ version 'CXXABI_1.3.8'问题处理
ERROR:libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ...) 此文是以 CentOS Linux 7 (AltArc ...
- flutter系列之:使用SliverList和SliverGird
目录 简介 SliverList和SliverGird详解 SliverList和SliverGird的使用 总结 简介 在上一篇文章我们讲解SliverAppBar的时候有提到过,Sliver的组件 ...
- vant组件,picker时间选择,自定义时间选择,实现datePacker,时间选择长期,增加长期选项,用于选择身份证到期时间等...
vant组件,picker时间选择,自定义时间选择,实现datePacker,时间选择长期,增加长期选项,用于选择身份证到期时间等... 最近项目中有个需求,datePicker选项,需要实现增加一个 ...
- JZOJ 4872.集体照
\(\text{Problem}\) 一年一度的高考结束了,我校要拍集体照.本届毕业生共分 \(n\) 个班,每个班的人数为 \(A_i\).这次拍集体照的要求非常奇怪:所有学生站一排,且相邻两个学生 ...
- Ubuntu18.04修改IP地址的方法
转载csdn: ubuntu18.04更改本地IP_lvjianjin128的博客-CSDN博客 Ubuntu18.04修改IP地址的方法_VLadimir_的博客-CSDN博客_ubuntu18.0 ...
- Ubuntu20.04获取root权限并用root用户登录
Ubuntu20.04获取root权限并用root用户登录 转载csdn:静水流深深深! https://blog.csdn.net/qq_42372079/article/details/11758 ...
- Connect-The-Dots
Connect-The-Dots 目录 Connect-The-Dots 1 信息收集 1.1 端口扫描 1.2 后台目录扫描 1.2.1 目录分析 2 目标服务安全检测 2.1 ftp检测 2.2 ...
- leaflet动态加载/手动绘制(圆、多边形)demo
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3 ...
- dom添加样式可以这样写
1.原生 js添加样式很多时可以合并在一起写: var oPopwin = document.getElementById('vpage'); oPopwin.style.margin = 'init ...
- ERROR: Functions in index expression must be marked IMMUTABLE
在创建函数索引时遇到报错,报错信息即为标题,下面是详细信息. 1 表定义 1234567 skytf=> \d test_39; Table "skytf.test_39" ...