<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                引入 Freemarker 模板的步驟如下: **1. 引入Freemarker依賴** ```xml <!-- 引入freemarker場景啟動器 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> <!-- 引入熱重載組件,對于靜態資源的訪問尤為重要 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> ``` **2. `resources/application.properties`** ```properties spring: freemarker: suffix: .html #指定freemarker模板的后綴名,freemarker默認的文件后綴為 .ftl,但是也可以指定為 .html cache: false #關閉頁面緩存,否則開發時看不到頁面變化 ``` **3. 模板文件默認存放在`resources/templates/`目錄** **4. 添加`.html`為后綴的freemarker模板** 如果你在`application.properties`中指定了 Freemarker 模板的后綴名為`.html`,為了支持 Freemarker 的語法,在 IDEA 添加`*.html`。 File -> Settings -> ![](https://img.kancloud.cn/3b/41/3b410c9563e5313aa9bf2b9684833151_1224x558.png) **5. 在模板文件添加freemarker的頭部說明** *`resources/templates/index.html`* ```html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"> <head> <meta charset="UTF-8"> <title>Index</title> </head> <body> <h1>歡迎使用freemarker</h1> </body> </html> ``` **6. controller層** ```java @Controller public class IndexController { @RequestMapping(value = "/index") public String index() { //會自動找到templates/index.html文件 return "index"; } } ``` **7. 測試** 啟動項目后訪問 http://localhost:8080/index ,界面將看到如下信息。 ```html 歡迎使用freemarker ``` ****
                  <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>

                              哎呀哎呀视频在线观看