Spring Boot项目中,如果你遇到了没有JSP实例的情况,这通常是因为Spring Boot默认不支持JSP。以下是一个简单的例子,说明如何配置Spring Boot以支持JSP。

确保你的Spring Boot项目中包含了以下依赖:

```xml

org.springframework.boot

spring-boot-starter-thymeleaf

javax.servlet

javax.servlet-api

provided

```

接下来,在`application.properties`或`application.yml`中配置Thymeleaf:

```properties

spring.thymeleaf.prefix=classpath:/templates/

spring.thymeleaf.suffix=.html

spring.thymeleaf.mode=HTML

```

然后,在`src/main/resources`目录下创建一个名为`templates`的文件夹,并在该文件夹中创建一个HTML文件,例如`index.html`。

```html

本文由 @夏夕 发布在 八方技术网,如有疑问,请联系我们。
文章链接:http://bflzx.cn/article/xYsVTr_AmpYlQJSdwkYJP