Skip to content

Commit ef59e18

Browse files
committed
✨ spring-boot-template-freemarker 完成
1 parent f077f1b commit ef59e18

File tree

13 files changed

+19
-15
lines changed

13 files changed

+19
-15
lines changed

spring-boot-template-freemarker/README.md renamed to spring-boot-demo-template-freemarker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# spring-boot-template-freemarker
1+
# spring-boot-demo-template-freemarker
22

33
> 本 demo 主要演示了 Spring Boot 项目如何集成 freemarker 模板引擎
44

spring-boot-template-freemarker/pom.xml renamed to spring-boot-demo-template-freemarker/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>com.xkcoding</groupId>
7-
<artifactId>spring-boot-template-freemarker</artifactId>
7+
<artifactId>spring-boot-demo-template-freemarker</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

11-
<name>spring-boot-template-freemarker</name>
11+
<name>spring-boot-demo-template-freemarker</name>
1212
<description>Demo project for Spring Boot</description>
1313

1414
<parent>
@@ -55,7 +55,7 @@
5555
</dependencies>
5656

5757
<build>
58-
<finalName>spring-boot-template-freemarker</finalName>
58+
<finalName>spring-boot-demo-template-freemarker</finalName>
5959
<plugins>
6060
<plugin>
6161
<groupId>org.springframework.boot</groupId>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* @modified: yangkai.shen
1818
*/
1919
@SpringBootApplication
20-
public class SpringBootTemplateFreemarkerApplication {
20+
public class SpringBootDemoTemplateFreemarkerApplication {
2121

2222
public static void main(String[] args) {
23-
SpringApplication.run(SpringBootTemplateFreemarkerApplication.class, args);
23+
SpringApplication.run(SpringBootDemoTemplateFreemarkerApplication.class, args);
2424
}
2525
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public ModelAndView index(HttpServletRequest request) {
3434
if (ObjectUtil.isNull(user)) {
3535
mv.setViewName("redirect:/user/login");
3636
} else {
37-
mv.setViewName("index");
37+
mv.setViewName("page/index");
3838
mv.addObject(user);
3939
}
4040

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ public ModelAndView login(User user, HttpServletRequest request) {
4040

4141
@GetMapping("/login")
4242
public ModelAndView login() {
43-
return new ModelAndView("login");
43+
return new ModelAndView("page/login");
4444
}
4545
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
server:
2+
port: 8080
3+
servlet:
4+
context-path: /demo
5+
spring:
6+
freemarker:
7+
suffix: .ftl
8+
cache: false

spring-boot-template-freemarker/src/main/resources/templates/index.ftl renamed to spring-boot-demo-template-freemarker/src/main/resources/templates/page/index.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!doctype html>
22
<html lang="en">
3-
<#include "./common/head.ftl">
3+
<#include "../common/head.ftl">
44
<body>
55
<div id="app" style="margin: 20px 20%">
66
欢迎登录,${user.name}

spring-boot-template-freemarker/src/main/resources/templates/login.ftl renamed to spring-boot-demo-template-freemarker/src/main/resources/templates/page/login.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!doctype html>
22
<html lang="en">
3-
<#include "./common/head.ftl">
3+
<#include "../common/head.ftl">
44
<body>
55
<div id="app" style="margin: 20px 20%">
66
<form action="/demo/user/login" method="post">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@RunWith(SpringRunner.class)
99
@SpringBootTest
10-
public class SpringBootTemplateFreemarkerApplicationTests {
10+
public class SpringBootDemoTemplateFreemarkerApplicationTests {
1111

1212
@Test
1313
public void contextLoads() {

spring-boot-template-freemarker/src/main/resources/application.yml

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

0 commit comments

Comments
 (0)