zoukankan      html  css  js  c++  java
  • 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 + /

      

    至此当你修改 thymeleaf 模板 HTML 时已经不需要重启项目了,解决了调试页面布局以及小的改动就要重启项目的烦恼!

    https://blog.csdn.net/ws_dj_love/article/details/95445590

    源码,是痛苦的,又是快乐的,如果没有这痛苦,也就没有了这快乐!
  • 相关阅读:
    set使用
    css盒子模型详解一
    列表页调用当前栏目的子类织梦标签
    织梦如何在导航栏下拉菜单中调用当前栏目子类
    HDU1812
    BZOJ1485: [HNOI2009]有趣的数列
    组合数学学习笔记
    Full_of_Boys训练2总结
    Full_of_Boys训练1总结
    FFT算法学习笔记
  • 原文地址:https://www.cnblogs.com/erlongxizhu-03/p/12193646.html
Copyright © 2011-2022 走看看