thymeleaf资源加载问题(从Controller跳转)

 1 DOCTYPE html>
 2 <html xmlns:th="http://www.thymeleaf.org">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 5     <title>Logintitle>
 6     
 7     <base th:href="@{/}">
 8     
 9     <link href="css/mycss.css" rel="stylesheet">
10  
11     
12     <script th:src="@{/js/myjs.js}">script>
13  
14 head>
15 <body onload="f()">
16 
17 <div class="mydiv">
18     <h1>配置Thymeleaf模板h1>
19     <table width="100%" border="1" cellspacing="1" cellpadding="0">
20         <tr>
21             <td>姓名td>
22             <td>年龄td>
23             <td>地址td>
24         tr>
25         <tr th:each="Admin:${list}" >
26             <td th:text="${Admin.id}">td>
27             <td th:text="${Admin.a_id}">td>
28             <td th:text="${Admin.a_pwd}">td>
29         tr>
30     table>
31     <h2>dddh2>
32 div>
33 body>
34 html>

个人比较倾向于在头部添加标签,这样就不用在每个需要引入的地方都使用Thymeleaf th:href="@{/路径}"语法.

 

参考:https://blog.csdn.net/PLA12147111/article/details/85131786

转载于:https://www.cnblogs.com/116970u/p/10670899.html

你可能感兴趣的:(thymeleaf资源加载问题(从Controller跳转))