SpringBoot thymeleaf eclipse熱配置方案の操作手順


インターネットではたくさんのspringboot熱配置案を探していますが、いくつかの方法を試してみました。以下は私の成功案を皆さんに共有します。
操作手順
1.pomに加熱配置の依存性を追加する

 <dependency>
   <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-devtools</artifactId>
       <optional>true</optional>
     </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
 </dependency>
2.プラグインの追加

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
  <fork>true</fork>
</configuration>
3.controllerにバックグラウンドジャンプを追加する

 @RequestMapping(value = "/index",method = RequestMethod.GET)
  public String hello(Model model) {
    model.addAttribute("name", "Dear");
    return "index";
  }
4.index.

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>        </title>
</head>
<body>helloword!
<p th:text="'Hello!, ' + ${name} + '!'" >3333</p>
     1111111
</body>
</html>
5. thymeleaf:

    mode: HTML5
    encoding: UTF-8
    content-type: text/html
   #       ,          
    cache: false
    cache-period: 0
  template:
      cache: false
6.自動コンパイル機能を開く
7.テストを行う
締め括りをつける
以上はこの文章の全部の内容です。本文の内容は皆さんの学習や仕事に対して一定の参考学習価値を持ってほしいです。ありがとうございます。もっと知りたいなら、下のリンクを見てください。