You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot 3.2.0中JSP连续更新无法即时重编译问题求助

Spring Boot 3.2.0(M1 Mac)下JSP连续更新不即时重编译问题

在M1 Mac上使用Spring Boot 3.2.0的JSP时,遇到连续更新同一JSP文件时,重编译不会立即触发,浏览器页面也不更新;但等待约5秒后,重编译就能正常生效。

具体表现

  • 有间隔操作场景:

    1. 更新JSP后立即访问 → 页面完成重编译并更新
    2. 等待几秒后再次更新JSP并立即访问 → 页面完成重编译并更新
  • 无间隔连续操作场景:

    1. 更新JSP后立即访问 → 页面完成重编译并更新
    2. 随即再次更新JSP并立即访问 → 重编译未触发,页面未更新

请问是否有配置可以解决该问题?


相关代码信息

视图文件 index.jsp

<!DOCTYPE html>
<html>
<head></head>
<body>
hello world
</body>
</html>

控制器代码 RootController.java

package com.example.mysite.controller;

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

@Controller
public class RootController {
  @GetMapping
  public String index() {
    return "index";
  }
}

application.properties 配置

spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
# These don't work
# server.jsp-servlet.init-parameters.modificationTestInterval=0
# server.jsp-servlet.init-parameters.development=true

编辑补充

已创建最小复现案例,通过IntelliJ创建Spring Boot项目后,仅修改了以下文件:

  • pom.xml
  • application.properties
  • RootController.java
  • index.jsp

注意到案例中首次修改也存在未即时生效的不稳定表现。


内容的提问来源于stack exchange,提问作者akai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 05:16:09