thymeleaf,idea 修改页面每次需要重启项目设置
环境:idea 2019.2
引入pom依赖:
复制代码
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!--热部署--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
yml配置:
spring: mvc: # “spring.mvc.static-path-pattern”用于阐述HTTP请求地址,请求非controller地址,如js,css,img等访问路径需要加上static # 而“spring.resources.static-locations”则用于描述静态资源的存放位置。多个路径(逗号隔开)中依次查找是否存在 # static-path-pattern: /static/** resources: static-locations: classpath:/static/,file:D:\\ thymeleaf: cache: false prefix: classpath:/templates/ suffix: .html mode: HTML5 encoding: UTF-8 # 热部署 devtools: restart: # 是否启用重启 enabled: true # 设置重启的目录 additional-paths: src/main/java #classpath目录下的WEB-INF文件夹内容修改不重启 spring.devtools.restart.exclude: WEB-INF/** # 指定程序的配置文件 # profiles: dev
五、File->settings->Build,Execution,Deployment->Complier:勾选Build project automatically -> apply ->ok
六、shift + alt + ctrl + /
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!