springboot默认不支持jsp做为视图

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/y41992910/article/details/84400767

今天在做整合springboot和springmvc的时候,发现一只返回不了jsp页面。
但是用@responsebody就可以正常返回。

最后发现是springboot默认是不支持jsp做为视图的。所以就会出现找不到页面(进入springboot默认的while page error),404的情况。

springboot整合jsp作为视图(不推荐使用jsp作为视图)
https://blog.csdn.net/yingxiake/article/details/51288727


遇到的另一个错误,错误情况1:
通过原因分析,造成问题有两个因素:

缺省转发
view和path同名
所以,解决方案如下
1.消除缺省转发
2.修改view和path,让他们不同名

javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/test/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

猜你喜欢

转载自blog.csdn.net/y41992910/article/details/84400767
今日推荐