最近学习配置springboot因为之前都用jsp所以也研究着怎么跳转jsp页面鼓捣了一晚上都是报错
Circular view path [index]: would dispatch back to the current handler URL [/index] again
先贴application.properties配置如下
spring.mvc.view.prefix: /
spring.mvc.view.suffix: .jsp
spring.messages.basename=validation
spring.thymeleaf.enabled=false
controller代码如下
@Controller
public class IndexController {
@RequestMapping("/login")
public String index() {
System.out.println("进来了");
return "index";
}
}
现在的这个配置文件是可以正常的访问到webapp中的index.jsp页面了如果要访问html就把application.properties第2个改成.hmtl
我奇怪的是如果吧application.properties配置中的3和4删掉,那么就无法访问webapp中index.jsp了只会跳转到resources中的index.html。无论如果把resources中的index.html删掉会直接报错500无法找到视图,也就是说3 4配置是跳转jsp的必要条件。
这是我研究出来的现象,但是我并不知道它的原理。。。希望大佬看到可以告知



