java

IDEA下自动预览Thymeleaf页面设置

2020-10-15  本文已影响0人  野猪先生XYJ

程序运行时的自动预览配置

我使用的是Thymeleaf,当设置自动预览后,修改静态页面后预览方便,但是修改.java后并不起作用

设定自动编译

image.png

勾选

快捷键【Ctrl + Alt + Shift + /】,通过【Maintenance】,进入【Registry】:


image.png

启用:compiler.automake.allow.when.app.running


image.png

需要关闭页面缓存

在application.yaml中配置:

server:
  port: 8080
spring:
  thymeleaf:
    prefix: classpath:/templates/
    suffix: .html
    mode: HTML5
    encoding: UTF-8
    cache: false   #一般开发时候设置为false
上一篇 下一篇

猜你喜欢

热点阅读