<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                引入 Thymeleaf 模板的步驟如下: **1. 引入thymeleaf依賴** ```xml <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> ``` **2. thymeleaf模板配置** (1)可以在 ThymeleafProperties 類中找到該模板的默認配置。 ```java ------------ThymeleafProperties部分源碼------------ @ConfigurationProperties( // 說明當你在application.properties或application.yml對Thymeleaf進行自己的配置時 // 應該以spring.thymeleaf為前綴的配置 prefix = "spring.thymeleaf" ) public class ThymeleafProperties { private static final Charset DEFAULT_ENCODING; public static final String DEFAULT_PREFIX = "classpath:/templates/"; // 說明thymeleaf模板文件默認放在resources/templates/目錄 public static final String DEFAULT_SUFFIX = ".html"; // 說明模板文件的后綴為 .html private boolean checkTemplate = true; private boolean checkTemplateLocation = true; private String prefix = "classpath:/templates/"; private String suffix = ".html"; private String mode = "HTML"; private Charset encoding; private boolean cache; ``` (2)`resources/application.yml` ```yml spring: thymeleaf: cache: false #關閉頁面緩存,否則開發時看不到頁面變化 ```` (3)Thymeleaf 模板文件位置:`resources/templates/index.html` ```html <!DOCTYPE html> <!-- xmlns:th引入thymeleaf模板,可以用于IDEA的語法提示,不引入也可以用,不過無語法提示 --> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h1>歡迎使用Thymeleaf</h1> </body> </html> ``` **3. controller層** ```java @Controller public class IndexController { @RequestMapping(value = "/index") public String index() { //會自動找到templates/index.html文件 return "index"; } } ``` **4. 測試** 啟動項目后訪問 http://localhost:8080/index ,界面將看到如下信息。 ```html 歡迎使用Thymeleaf ``` **** Thymeleaf官網:https://www.thymeleaf.org/index.html Thymeleaf語法文檔地址[10 Attribute Precedence](https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#attribute-precedence) Thymeleaf表達式文檔地址:[4 Standard Expression Syntax](https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#standard-expression-syntax)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看