How to reload templates without restarting the spring boot application?
See original GitHub issueI deploy my spring boot application with maven by spring-boot:run
in intellij-idea
. I must restart my application after I update the template files. Is there some methods that can update templates automatically instead of restarting the application?
I have already putted spring-boot-devtools
in pom.xml:
<!-- hot swap -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>1.3.0.RELEASE</version>
<optional>true</optional>
</dependency>
p.s: sorry, maybe there are some grammar errors. English isn’t my native language.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:13 (2 by maintainers)
Top Results From Across the Web
spring - Live reload for thymeleaf template - Stack Overflow
"Live reload" in terms of Spring Boot applications means that you do not need to restart your application server after editing your html....
Read more >84. Hot swapping - Spring
84.2 Reload templates without restarting the container ... The spring-boot-devtools module includes support for automatic application restarts.
Read more >Spring Boot & IntelliJ IDEA: Auto reload Thymeleaf templates ...
A detailed article to learn how to auto-reload Thymeleaf templates without restarting the Spring Boot application in IntelliJ IDEA.
Read more >Spring Boot and Thymeleaf: Reload templates and static ...
Assuming the all templates are in the path specified, changing them will require a page refresh but not application / server restart. Both ......
Read more >Spring Boot auto reload changes using LiveReload and ...
Add the dependency spring-boot-devtools to your project's build file (pom.xml). · Install LiveReload extension for your browser. · Restart your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found from the tutorial here: https://attacomsian.com/blog/spring-boot-auto-reload-thymeleaf-templates it works for me when i added both
Spring Boot offers a
spring.thymeleaf.cache
configuration property which you can set tofalse
if you want to disable the template cache so that templates can be modified on the fly.Note however that Maven’s
spring-boot:run
does run templates from the generated überjar, so I don’t think this would work. However, if you run your application from IntelliJ IDEA by selecting the application class and choosingRun...
(you seem to cite these two methods as the same thing but they are actually different ways to start your app), then you should be able to see changes in your templates simply by asking IntelliJ to build the project (⌘+F9
in macOS,Ctrl+F9
in Windows).