Spring Boot,无需重新启动应用程序即可更新前端

wss*_*rld 6 java spring-tool-suite spring-boot

在Spring Boot中,在不重新启动应用程序的情况下更新前端部分?

小智 6

我发现静态网页和css的最佳解决方案是 /sf/answers/2753407891/ ,无需重新启动服务器即可加载代码(包括jsp),可以使用Spring Boot Devtools依赖项

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    </dependency>
Run Code Online (Sandbox Code Playgroud)


Dav*_*yer 5

我是Eclipse用户(通过Spring Tool Suite),如果应用程序在调试模式下运行,我在重新加载静态内容时从未遇到任何问题.只需右键单击主类和"Debug As-> Java App"(或"Spring Boot App",它就是一样的).您还必须确保工作区配置为"自动构建",但据我所知,这是默认设置.

我不能为其他IDE的用户提供这样的具体建议,但我确信它们都具有相同的功能.