Spring Boot, update frontend without restarting the application

I'm an Eclipse user (via Spring Tool Suite) and I never have any problems with reloading static content if the app is running in debug mode. Just right click on the main class and "Debug As->Java App" (or "Spring Boot App", it's the same). You have to also ensure that the workspace is configured to "Build Automatically", but that is the default as far as I know.

I can't offer such specific advice for users of other IDEs, but I'm sure they all have the same feature.


Best solution i found for static webpages and css is https://stackoverflow.com/a/39334398/6467734 and for loading code (including jsp) without restarting the server you can use Spring Boot Devtools dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>

In the Intellij IDEA run up your project in Debug mode and you will get the same effect.

Or externalize your static .

@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {

    private String extStaticPath = "/var/www/site1/";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**")
                .addResourceLocations(extStaticPath)
                .setCachePeriod(0);
    }
}