IDEA下spring boot+fremarker启动报错would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup!

详细报错代码(ps:标题中写不下报错主要代码)

javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
    at org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:209) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:147) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1325) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1069) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1008) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]

1.问题由来

    IDEA中测试使用spring boot+freemarker时启动报错

2.原因

    @RequestMapping("hello")中的路径与映射方法返回的视图名冲突了,不能写一样的

如图

    (原来哪个代码图片找不到了,所以就直接写了一个,这只是例子,所以图中的错误可以忽略)

3.解决方法

    改一下视图名或者@RequestMapping 中的值就可以了....

4.总结

其实都不是什么很高深的错误,但是是新手很容易犯的错误,避免之...

引用

我曾踏足山巅,也曾跌落低谷,二者都使我受益良多----宝石骑士

原文地址:https://www.cnblogs.com/cailiang1026/p/9608805.html

时间: 2024-12-08 23:59:13

IDEA下spring boot+fremarker启动报错would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup!的相关文章

关于spring boot项目启动报错问题

这次用了spring boot,项目在启动时报错,由于我用的是jdk 1.7 ,该项目默认的是jdk 1.8,所以要把下面这一系列配置改好才行.废话不多说,上图: 一看发现,项目环境没有配全,打开file->Project Structuer,找到Project ,把里面的jdk配置成你自己的. 还有Modules里面的的这几项: 然后找到file->setting-->Java Compiler 里面 这些都配置好才能起动main函数启动服务.

spring boot 整合kafka 报错 Exception thrown when sending a message with key='null' and payload=JSON to topic proccess_trading_end: TimeoutException: Failed to update metadata after 60000 ms.

org.springframework.kafka.support.LoggingProducerListener- Exception thrown when sending a message with key='null' and payload='{"dataDts":["20180329","20180328","20180327","20180326","20180323"]

Spring Boot配置FastJson报错'Content-Type' cannot contain wildcard type '*'

https://www.cnblogs.com/xiaopotian/p/8654993.html 升级到最新版本的fastjson以后报的错,查了一下资料,发现 fastjson从1.1.41升级到1.2.28之后,请求报错:json java.lang.IllegalArgumentException: 'Content-Type' cannot contain wildcard type '*' 原因是在1.1.41中,FastJsonHttpMessageConverter初始化时,设置

Spring Boot连接MySQL报错“Internal Server Error”的解决办法

报错信息如下: {timestamp: "2018-06-14T03:48:23.436+0000", status: 500, error: "Internal Server Error",-} error : "Internal Server Error" message : "Could not open JDBC Connection for transaction; nested exception is java.sql.S

spring boot 2.0 报错:“jdbcUrl is required with driverClassName.” 解决办法!

springboot 升级到2.0之后发现配置多数据源的时候报错: "jdbcUrl is required with driverClassName."或者Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.] with root cause 主要原因是在1.0 配置数据源的过程中主要是写成:spring.datasource.url 和

Jmeter启动报错:Not able to find Java executable or version. Please check your Java installation

启动高版本的jmeter5.0报错,如下图: 解决方案: 1.配置jmeter环境,修改path:%SystemRoot%\system32;%SystemRoot%; 添加在最前面 2.jmeter.bat文件前面加上以上两句: SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51 (jdk路径)SET PATH=%SystemRoot%/system32;%SystemRoot%;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

spring+mybatis项目启动报错Initializing Spring root WebApplicationContext

where <![CDATA[ rn > (#{pageNumber,jdbcType=DECIMAL} - 1) * #{pageSize,jdbcType=DECIMAL} ]]> and <![CDATA[ rn <= #{pageNumber,jdbcType=DECIMAL} * #{pageSize,jdbcType=DECIMAL} ]]>

jmeter安装启动报错:Not able to find Java executable or version. Please check your Java installation

1.xp安装jmeter后启动,出现下面错误,找了很多方法试了,都没有用: 2.最后找到一个方法解决了[感谢无名大神],在环境变量PATH中添加:%SystemRoot%/system32;%SystemRoot%; 3.可以正常启动了: 'findstr' 不是内部或外部命令,也不是可运行的程序或批处理文件.Not able to find Java executable or version. Please check your Java installation.errorlevel=2请

【问题解决方案】之 jmeter启动报错:Not able to find Java executable or version. Please check your Java installation

故事发生在云计算实验课上-- ** 故事发生在云计算实验课上-- Step 1 在Xshell中登录自己的cloud虚拟机后,<sudo su ->切换到root用户 Step 2 <~/tpcw/apache-tomcat-8.5.23/bin/startup.sh>启动虚拟机装好的TPC-W(an e-commerce website, which supports online shopping and payment) Step 3 Download Apache Jmet