在 Spring Boot 项目中,默认情况下是不支持 JSP 的。Spring Boot 主要使用 Thymeleaf、FreeMarker 或其他模板引擎来生成动态网页。以下是一个简单的例子,展示如何在 Spring Boot 中使用 Thymeleaf 替代 JSP。

在 `pom.xml` 文件中添加 Thymeleaf 依赖:

```xml

org.springframework.boot

spring-boot-starter-thymeleaf

```

然后,创建一个控制器 `HelloController`:

```java

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.GetMapping;

@Controller

public class HelloController {

@GetMapping("