Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bluewinestar
spring-boot-examples
提交
e6ceae59
S
spring-boot-examples
项目概览
bluewinestar
/
spring-boot-examples
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-boot-examples
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6ceae59
编写于
3月 08, 2019
作者:
微笑很纯洁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update thymeleaf to 4.0
上级
21f0073f
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
576 addition
and
56 deletion
+576
-56
spring-boot-thymeleaf/pom.xml
spring-boot-thymeleaf/pom.xml
+0
-35
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/pom.xml
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/pom.xml
+66
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/java/com/neo/TLayoutApplication.java
...leaf-layout/src/main/java/com/neo/TLayoutApplication.java
+13
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/java/com/neo/web/IndexController.java
...eaf-layout/src/main/java/com/neo/web/IndexController.java
+31
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/application.properties
...hymeleaf-layout/src/main/resources/application.properties
+2
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/base.html
...t-thymeleaf-layout/src/main/resources/templates/base.html
+15
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/fragment.html
...ymeleaf-layout/src/main/resources/templates/fragment.html
+11
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/home.html
...t-thymeleaf-layout/src/main/resources/templates/home.html
+11
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/index.html
...-thymeleaf-layout/src/main/resources/templates/index.html
+11
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout.html
...thymeleaf-layout/src/main/resources/templates/layout.html
+15
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/copyright.html
...layout/src/main/resources/templates/layout/copyright.html
+12
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/footer.html
...af-layout/src/main/resources/templates/layout/footer.html
+12
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/header.html
...af-layout/src/main/resources/templates/layout/header.html
+12
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/left.html
...leaf-layout/src/main/resources/templates/layout/left.html
+12
-0
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/test/java/com/neo/TLayoutApplicationTests.java
...layout/src/test/java/com/neo/TLayoutApplicationTests.java
+16
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/pom.xml
spring-boot-thymeleaf/spring-boot-thymeleaf/pom.xml
+62
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/ThymeleafApplication.java
...thymeleaf/src/main/java/com/neo/ThymeleafApplication.java
+13
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/model/User.java
...ring-boot-thymeleaf/src/main/java/com/neo/model/User.java
+49
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/ExampleController.java
...hymeleaf/src/main/java/com/neo/web/ExampleController.java
+66
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/HelloController.java
...-thymeleaf/src/main/java/com/neo/web/HelloController.java
+16
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/application.properties
...-boot-thymeleaf/src/main/resources/application.properties
+1
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/eq.html
...pring-boot-thymeleaf/src/main/resources/templates/eq.html
+17
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/hello.html
...ng-boot-thymeleaf/src/main/resources/templates/hello.html
+10
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/if.html
...pring-boot-thymeleaf/src/main/resources/templates/if.html
+15
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/list.html
...ing-boot-thymeleaf/src/main/resources/templates/list.html
+20
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/string.html
...g-boot-thymeleaf/src/main/resources/templates/string.html
+16
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/switch.html
...g-boot-thymeleaf/src/main/resources/templates/switch.html
+17
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/url.html
...ring-boot-thymeleaf/src/main/resources/templates/url.html
+19
-0
spring-boot-thymeleaf/spring-boot-thymeleaf/src/test/java/com/neo/ThymeleafApplicationTests.java
...leaf/src/test/java/com/neo/ThymeleafApplicationTests.java
+16
-0
spring-boot-thymeleaf/src/main/java/com/neo/thymeleaf/ThymeleafApplication.java
...src/main/java/com/neo/thymeleaf/ThymeleafApplication.java
+0
-20
spring-boot-thymeleaf/src/main/resources/application.properties
...-boot-thymeleaf/src/main/resources/application.properties
+0
-1
未找到文件。
spring-boot-thymeleaf/pom.xml
已删除
100644 → 0
浏览文件 @
21f0073f
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
spring-boot-thymeleaf
</artifactId>
<name>
spring-boot-thymeleaf
</name>
<description>
spring-boot-thymeleaf
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.6.RELEASE
</version>
</parent>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/pom.xml
0 → 100644
浏览文件 @
e6ceae59
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-thymeleaf-layout
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
spring-boot-thymeleaf-layout
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.0.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
<dependency>
<groupId>
nz.net.ultraq.thymeleaf
</groupId>
<artifactId>
thymeleaf-layout-dialect
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<scope>
runtime
</scope>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<fork>
true
</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/java/com/neo/TLayoutApplication.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
TLayoutApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
TLayoutApplication
.
class
,
args
);
}
}
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/java/com/neo/web/IndexController.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo.web
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@Controller
public
class
IndexController
{
@RequestMapping
(
"/index"
)
public
String
index
()
{
return
"index"
;
}
@RequestMapping
(
"/fragment"
)
public
String
fragment
()
{
return
"fragment"
;
}
@RequestMapping
(
"/layout"
)
public
String
layout
()
{
return
"layout"
;
}
@RequestMapping
(
"/home"
)
public
String
home
()
{
return
"home"
;
}
}
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/application.properties
0 → 100644
浏览文件 @
e6ceae59
com.neo.title
=
\u
7EAF
\u
6D01
\u7684\u
5FAE
\u
7B11
com.neo.description
=
\u5206\u
4EAB
\u
751F
\u
6D3B
\u
548C
\u6280\u
672F
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/base.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head
th:fragment=
"common_header(title,links)"
>
<title
th:replace=
"${title}"
>
comm title
</title>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"all"
th:href=
"@{/css/myapp.css}"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/favicon.ico}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/myapp.js}"
></script>
<th:block
th:replace=
"${links}"
/>
</head>
<body>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/fragment.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head
th:replace=
"base :: common_header(~{::title},~{::link})"
>
<title>
Fragment - Page
</title>
<link
rel=
"stylesheet"
th:href=
"@{/css/bootstrap.min.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/cs/fragment.css}"
>
</head>
<body>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/home.html
0 → 100644
浏览文件 @
e6ceae59
<html
xmlns:th=
"http://www.thymeleaf.org"
xmlns:layout=
"http://www.ultraq.net.nz/web/thymeleaf/layout"
layout:decorate=
"layout"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Home
</title>
</head>
<body>
<div
layout:fragment=
"content"
>
<h2>
个性化的内容
</h2>
</div>
</body>
</html>
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/index.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Index
</title>
</head>
<body>
<div
th:insert=
"layout/copyright :: copyright"
></div>
<div
th:replace=
"layout/copyright :: copyright"
></div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
xmlns:layout=
"http://www.ultraq.net.nz/web/thymeleaf/layout"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Layout
</title>
</head>
<body>
<div
>
<div
th:replace=
"layout/header :: header"
></div>
<div
th:replace=
"layout/left :: left"
></div>
<div
layout:fragment=
"content"
>
content
</div>
<div
th:replace=
"layout/footer :: footer"
></div>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/copyright.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Title
</title>
</head>
<body>
<copyright
th:fragment=
"copyright"
>
©
2018
</copyright>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/footer.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
footer
</title>
</head>
<body>
<footer
th:fragment=
"footer"
>
<h1>
我是 尾部
</h1>
</footer>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/header.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
header
</title>
</head>
<body>
<header
th:fragment=
"header"
>
<h1>
我是 头部
</h1>
</header>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/left.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
left
</title>
</head>
<body>
<left
th:fragment=
"left"
>
<h1>
我是 左侧
</h1>
</left>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf-layout/src/test/java/com/neo/TLayoutApplicationTests.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
TLayoutApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
spring-boot-thymeleaf/spring-boot-thymeleaf/pom.xml
0 → 100644
浏览文件 @
e6ceae59
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-thymeleaf
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
spring-boot-thymeleaf
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.0.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<scope>
runtime
</scope>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<fork>
true
</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/ThymeleafApplication.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
ThymeleafApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ThymeleafApplication
.
class
,
args
);
}
}
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/model/User.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo.model
;
import
org.hibernate.validator.constraints.Length
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Size
;
public
class
User
{
private
String
name
;
private
int
age
;
private
String
pass
;
public
User
(
String
name
,
int
age
,
String
pass
)
{
this
.
name
=
name
;
this
.
age
=
age
;
this
.
pass
=
pass
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getAge
()
{
return
age
;
}
public
void
setAge
(
int
age
)
{
this
.
age
=
age
;
}
public
String
getPass
()
{
return
pass
;
}
public
void
setPass
(
String
pass
)
{
this
.
pass
=
pass
;
}
@Override
public
String
toString
()
{
return
(
"name="
+
this
.
name
+
",age="
+
this
.
age
+
",pass="
+
this
.
pass
);
}
}
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/ExampleController.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo.web
;
import
com.neo.model.User
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Controller
public
class
ExampleController
{
@RequestMapping
(
"/string"
)
public
String
string
(
ModelMap
map
)
{
map
.
addAttribute
(
"userName"
,
"ityouknow"
);
return
"string"
;
}
@RequestMapping
(
"/if"
)
public
String
ifunless
(
ModelMap
map
)
{
map
.
addAttribute
(
"flag"
,
"yes"
);
return
"if"
;
}
@RequestMapping
(
"/list"
)
public
String
list
(
ModelMap
map
)
{
map
.
addAttribute
(
"users"
,
getUserList
());
return
"list"
;
}
@RequestMapping
(
"/url"
)
public
String
url
(
ModelMap
map
)
{
map
.
addAttribute
(
"type"
,
"link"
);
map
.
addAttribute
(
"pageId"
,
"springcloud/2017/09/11/"
);
map
.
addAttribute
(
"img"
,
"http://www.ityouknow.com/assets/images/neo.jpg"
);
return
"url"
;
}
@RequestMapping
(
"/eq"
)
public
String
eq
(
ModelMap
map
)
{
map
.
addAttribute
(
"name"
,
"neo"
);
map
.
addAttribute
(
"age"
,
30
);
map
.
addAttribute
(
"flag"
,
"yes"
);
return
"eq"
;
}
@RequestMapping
(
"/switch"
)
public
String
switchcase
(
ModelMap
map
)
{
map
.
addAttribute
(
"sex"
,
"woman"
);
return
"switch"
;
}
private
List
<
User
>
getUserList
(){
List
<
User
>
list
=
new
ArrayList
<
User
>();
User
user1
=
new
User
(
"大牛"
,
12
,
"123456"
);
User
user2
=
new
User
(
"小牛"
,
6
,
"123563"
);
User
user3
=
new
User
(
"纯洁的微笑"
,
66
,
"666666"
);
list
.
add
(
user1
);
list
.
add
(
user2
);
list
.
add
(
user3
);
return
list
;
}
}
\ No newline at end of file
spring-boot-thymeleaf/s
rc/main/java/com/neo/thymeleaf
/HelloController.java
→
spring-boot-thymeleaf/s
pring-boot-thymeleaf/src/main/java/com/neo/web
/HelloController.java
浏览文件 @
e6ceae59
package
com.neo.
thymeleaf
;
package
com.neo.
web
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Controller
public
class
HelloController
{
@RequestMapping
(
"/hello"
)
public
String
hello
(
Model
model
,
@RequestParam
(
value
=
"name"
,
required
=
false
,
defaultValue
=
"World"
)
String
name
)
{
model
.
addAttribute
(
"name"
,
name
);
@RequestMapping
(
"/"
)
public
String
index
(
ModelMap
map
)
{
map
.
addAttribute
(
"message"
,
"http://www.ityouknow.com"
);
return
"hello"
;
}
}
}
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/application.properties
0 → 100644
浏览文件 @
e6ceae59
spring.thymeleaf.cache
=
false
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/eq.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example gt eq
</title>
</head>
<body>
<div
>
<h1>
EQ
</h1>
<input
th:value=
"${name}"
/>
<br/>
<input
th:value=
"${age gt 30 ? '中年':'年轻'}"
/>
<br/>
<a
th:if=
"${flag eq 'yes'}"
th:href=
"@{http://favorites.ren/}"
>
favorites
</a>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/src/main/resources/templates/hello.html
→
spring-boot-thymeleaf/s
pring-boot-thymeleaf/s
rc/main/resources/templates/hello.html
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
/
>
<title>
Hello
Thymeleaf!
</title>
<meta
charset=
"UTF-8"
></meta
>
<title>
Hello
</title>
</head>
<body>
<p
th:text=
"'Hello, ' + ${name} + '!'"
/
>
<h1
th:text=
"${message}"
>
Hello World
</h1
>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/if.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example If/Unless
</title>
</head>
<body>
<div
>
<h1>
If/Unless
</h1>
<a
th:if=
"${flag == 'yes'}"
th:href=
"@{http://favorites.ren/}"
>
home
</a>
<br/>
<a
th:unless=
"${flag != 'no'}"
th:href=
"@{http://www.ityouknow.com/}"
>
ityouknow
</a>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/list.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example If/Unless
</title>
</head>
<body>
<div
>
<h1>
for 循环
</h1>
<table>
<tr
th:each=
"user,iterStat : ${users}"
>
<td
th:text=
"${user.name}"
>
neo
</td>
<td
th:text=
"${user.age}"
>
6
</td>
<td
th:text=
"${user.pass}"
>
213
</td>
<td
th:text=
"${iterStat.index}"
>
index
</td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/string.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example String
</title>
</head>
<body>
<div
>
<h1>
text
</h1>
<p
th:text=
"${userName}"
>
neo
</p>
<span
th:text=
"'Welcome to our application, ' + ${userName} + '!'"
></span>
<br/>
<span
th:text=
"|Welcome to our application, ${userName}!|"
></span>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/switch.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example switch
</title>
</head>
<body>
<div
>
<div
th:switch=
"${sex}"
>
<p
th:case=
"'woman'"
>
她是一个姑娘...
</p>
<p
th:case=
"'man'"
>
这是一个爷们!
</p>
<!-- *: case的默认的选项 -->
<p
th:case=
"*"
>
未知性别的一个家伙。
</p>
</div>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/url.html
0 → 100644
浏览文件 @
e6ceae59
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
Example If/Unless
</title>
</head>
<body>
<div
>
<h1>
URL
</h1>
<a
th:href=
"@{http://www.ityouknow.com/{type}(type=${type})}"
>
link1
</a>
<br/>
<a
th:href=
"@{http://www.ityouknow.com/{pageId}/can-use-springcloud.html(pageId=${pageId})}"
>
view
</a>
<br/>
<div
th:style=
"'background:url(' + @{${img}} + ');'"
>
<br/><br/><br/>
</div>
</div>
</body>
</html>
\ No newline at end of file
spring-boot-thymeleaf/spring-boot-thymeleaf/src/test/java/com/neo/ThymeleafApplicationTests.java
0 → 100644
浏览文件 @
e6ceae59
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
ThymeleafApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
spring-boot-thymeleaf/src/main/java/com/neo/thymeleaf/ThymeleafApplication.java
已删除
100644 → 0
浏览文件 @
21f0073f
package
com.neo.thymeleaf
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.support.SpringBootServletInitializer
;
@SpringBootApplication
public
class
ThymeleafApplication
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
ThymeleafApplication
.
class
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
ThymeleafApplication
.
class
,
args
);
}
}
spring-boot-thymeleaf/src/main/resources/application.properties
已删除
100644 → 0
浏览文件 @
21f0073f
spring.thymeleaf.cache
:
false
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录