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时你并没有 ...
随机推荐
- 梳理selenium的鼠标方法
梳理selenium的鼠标方法 你需要有一定的selenium基础 基本用法 包导入 from selenium.webdriver import ActionChains 调用方式一:链式调用 ...
- java 金额计算
package com.example.test; import android.util.Log; import java.math.BigDecimal; import java.text.Dec ...
- exgcd & 线性同余方程
前置芝士 裴蜀定理 同余的性质 exgcd exgcd即扩展欧几里得定理,常用来求解\(ax + by = gcd(a,b)\)的可行解问题 推导过程: 考虑我们有: \(ax + by = gc ...
- ROS多机通讯
1.主机: sudo /etc/hosts 写入从机的地址和用户名: 192.168.31.14 raspi2 2.从机 sudo /etc/hosts 写入主机的地址和用户名 192.168. ...
- LOJ 数列分块入门 8
\(\text{Solution}\) 一看有区间赋值直接上 \(ODT\) \(\text{Code}\) #include <cstdio> #include <iostream ...
- 【NOIP2017提高组正式赛】列队
题解 本题的解法是丰富多彩的! 线段树做法是极好的 代码非常之少 一个很显然的想法是维护 \(n+1\) 颗线段树 那要怎么维护才能不爆空间呢? 我们发现尽管 \(n \times m\) 那么大 但 ...
- Python arcpy创建栅格、批量拼接栅格
本文介绍基于Python语言arcpy模块,实现栅格影像图层建立与多幅遥感影像数据批量拼接(Mosaic)的操作. 首先,相关操作所需具体代码如下: import os import arcp ...
- CCRD_TOC_2008年第1期
中信国健临床通讯 2008年第1期 目 录 类风湿关节炎 1 一种新型.实用的RA活动度评估方法:完成评估只需三分钟 Fleischmann RM, Schiff MH, Keystone EC, ...
- PostGIS之维数扩展的九交模型
1. 概述 PostGIS 是PostgreSQL数据库一个空间数据库扩展,它添加了对地理对象的支持,允许在 SQL 中运行空间查询 PostGIS官网:About PostGIS | PostGIS ...
- Apache HttpClient使用和源码分析
在上文中分析了 HttpURLConnection的用法,功能还是比较简单的,没有什么封装 接下来看看Apache HttpClient是如何封装httpClient的 目录 组成 请求代码 代码分析 ...