idea中SpringBoot与jsp整合,404页面找不到

报如下错误:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Oct 04 21:23:05 CST 2020
There was an unexpected error (type=Not Found, status=404).
/WEB-INF/jsp/user/details.jsp
在这里插入图片描述

首先在网上找到如下解决方案:

在working directory中写上自己模块或者项目的路径
在这里插入图片描述

但是添加之后还是报错

经过长久时间的探索之后发现是webapp名字写错了,因为idea添加框架支持里面的
1、点击右键,选择Add Framework Support
在这里插入图片描述
2、选择Web Application之后出来是web而不是webapp目录,所以还是报这个错。
在这里插入图片描述

改成webapp名字之后,项目就可以正常启动了

在这里插入图片描述

当然项目结构里面的路径也要改对

在这里插入图片描述

正常启动截图

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44635198/article/details/108922900