Browse Source

修改静态页面跳转

5 years ago
parent
commit
61515f334c

+ 5 - 2
website/src/main/resources/application.properties

@@ -11,9 +11,12 @@ server.connection-timeout=18000000s
 spring.thymeleaf.cache=false
 # 后缀
 spring.thymeleaf.suffix=.html
-#spring.thymeleaf.prefix=classpath:/templates/
+## 模板引擎找寻的静态资源文件夹
+spring.thymeleaf.prefix=classpath:/templates/
 spring.thymeleaf.encoding=UTF-8
-#spring.thymeleaf.mode=HTML5
+spring.thymeleaf.mode=HTML5
+## 用于静态页面间的跳转(静态资源的存放文件夹)
+spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/templates/
 spring.thymeleaf.jackson.time-zone=GMT+8
 spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 # ####################################################################################################

+ 1 - 0
website/src/main/resources/templates/hello.html

@@ -6,6 +6,7 @@
 <body>
 <h4>
     <h1>开始 展示 数据</h1>
+    <a href="index.html">跳转到index</a>
     <!--<span th:each="item:${list}"> ${item.title}</span>-->
     <p th:text="${name}">111</p>
 

+ 3 - 2
website/src/main/resources/templates/index.html

@@ -6,11 +6,12 @@
 </head>
 <body>
 <h1>shouye </h1>
-<h1>开始 展示 数据</h1>
+<h1>开始 展示 数据2222</h1>
 <!--<span th:each="item:${list}"> ${item.title}</span>-->
 <p th:text="${name}">111</p>
-
+<a href="hello.html">跳转到hello</a>
 <div th:each="item : ${list}">
+
     <h1 th:text="${{item.type}}"></h1>
     <p><a th:text="${{item.title}}"></a></p>
 </div>