首页 > spring boot使用SpringMVC怎么才能返回一个视图,比如jsp

spring boot使用SpringMVC怎么才能返回一个视图,比如jsp

现在的情况是只能返回一个json.

报错信息如下:

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

配置文件:


虽然没试过,我觉得jsp文件应该放在resources下面


官方不建议JSP的,freemarker什么的都可以


据说spring boot支持最好的是thymeleaf,html里面直接写模板标签就好了,虽然我也是初学者,不过我看到很多教程建议不要用JSP,所以你的问题应该很少有人遇到^^

【热门文章】
【热门文章】