我想访问index.jsp目录,系统却显示的是index.html,为什么

你好,我使用springboot,却发现一个问题,我的文件结构如下:

img

我在static文件夹下有两个网页,一个是jsp的,一个是html的。
jsp如下

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
我的文件
</body>
</html>


html如下


```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>


当我输入localhost:8080时,显示的却是index.html的页面,而我要的是index.jsp的页面。而且我输入localhost:8080/index.jsp时,却不能显示该页面,而是将JSP代码以文件的形式下载到桌面上,这是为什么呢,怎么改。我使用的是Springboot,用的是IDEA。
这是application.properties里面的内容
spring.datasource.url = jdbc:mysql://localhost:3306/mydb2
spring.datasource.username = root
spring.datasource.password = 123456
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10
spring.mvc.view.prefix=/WEB-INF/jsp
spring.mvc.view.suffix=.jsp
要更改这里的内容吗?

springboot默认的前端解析是thymeleaf,他使用的就是html。至于你用JSP的话,得自己配置

配置首页访问,编辑web.xml

<!-- 
    1. 路径从webapp的根下——web文件开始
    2. 路径开头不需要加 /
    3. 可以是设置多个欢迎页,从上到下寻找
    4. 也可以是一个servlet
-->
<welcome-file-list>
    <welcome-file-list>index.jsp</welcome-file-list>
</welcome-file-list>