Skip to content

Commit dc2c822

Browse files
committed
web模块优化
1 parent fad6094 commit dc2c822

File tree

15 files changed

+44
-133
lines changed

15 files changed

+44
-133
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<module>mybatis</module>
3131
<!-- freemarker -->
3232
<module>freemarker</module>
33-
<!-- velocity -->
34-
<module>velocity</module>
33+
<!-- thymeleaf -->
34+
<module>thymeleaf</module>
3535
<!-- 多数据源 -->
3636
<module>multipleSource</module>
3737
<!-- 数据接口 -->
File renamed without changes.

velocity/pom.xml renamed to thymeleaf/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12-
<artifactId>velocity</artifactId>
12+
<artifactId>thymeleaf</artifactId>
1313
<dependencies>
1414
<dependency>
1515
<groupId>info.xiaomo</groupId>
@@ -18,8 +18,7 @@
1818
</dependency>
1919
<dependency>
2020
<groupId>org.springframework.boot</groupId>
21-
<artifactId>spring-boot-starter-velocity</artifactId>
22-
<version>1.4.1.RELEASE</version>
21+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
2322
</dependency>
2423
</dependencies>
2524

velocity/src/main/java/info/xiaomo/velocity/VelocityMain.java renamed to thymeleaf/src/main/java/info/xiaomo/thymeleaf/ThymeleafMain.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
package info.xiaomo.velocity;
1+
package info.xiaomo.thymeleaf;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
55
import org.springframework.boot.autoconfigure.domain.EntityScan;
6+
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7+
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
68
import org.springframework.context.annotation.ComponentScan;
79
import org.springframework.context.annotation.Configuration;
810

@@ -20,13 +22,13 @@
2022
* Copyright(©) 2015 by xiaomo.
2123
**/
2224
@Configuration
23-
@EnableAutoConfiguration
25+
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
2426
@ComponentScan("info.xiaomo")
2527
@EntityScan("info.xiaomo.*.model")
26-
public class VelocityMain {
28+
public class ThymeleafMain {
2729

2830
public static void main(String[] args) throws Exception {
29-
SpringApplication.run(VelocityMain.class, args);
31+
SpringApplication.run(ThymeleafMain.class, args);
3032
}
3133

3234

velocity/src/main/java/info/xiaomo/velocity/controller/VelocityController.java renamed to thymeleaf/src/main/java/info/xiaomo/thymeleaf/controller/ThymeleafController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.xiaomo.velocity.controller;
1+
package info.xiaomo.thymeleaf.controller;
22

33
import org.springframework.stereotype.Controller;
44
import org.springframework.ui.ModelMap;
@@ -19,11 +19,11 @@
1919
**/
2020

2121
@Controller
22-
public class VelocityController {
22+
public class ThymeleafController {
2323

2424
@RequestMapping("hello")
2525
public String hello(ModelMap map) {
26-
map.put("host", "使用Velocity!");
26+
map.put("hello", "使用thymeleaf!");
2727
return "index";
2828
}
2929

File renamed without changes.
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
3+
>
4+
<head>
5+
<title>Hello World!</title>
6+
</head>
7+
<body>
8+
<h1 th:inline="text">Hello.v.2</h1>
9+
<p th:text="${hello}"></p>
10+
</body>
11+
</html>

velocity/src/main/resources/templates/index.vm

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)