提交 3a361e41 编写于 作者: S shenhongxi

thymeleaf

上级 ed34a11c
......@@ -117,6 +117,10 @@
<artifactId>pagehelper</artifactId>
<version>4.1.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
......@@ -125,10 +129,11 @@
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<!--<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<include>**/*.html</include>
</includes>-->
<filtering>true</filtering>
</resource>
</resources>
......
......@@ -6,6 +6,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
/**
* Created by shenhongxi on 2017/3/27.
*/
......@@ -17,8 +19,14 @@ public class UserController {
private UserConfig userConfig;
@RequestMapping("/")
public String home(Map<String,Object> map) {
map.put("hello", "Hi, boy!");
return "index";
}
@RequestMapping("/do")
@ResponseBody
String home() {
public String doSth() {
return userConfig.getWelcome();
}
......
......@@ -59,4 +59,4 @@ toutiao.loginSuccessIndex=http://${toutiao.domain}/index.html
user.welcome=Hello, World!
user.noFilterUrl=/,/login
spring.thymeleaf.cache=false
\ No newline at end of file
......@@ -59,4 +59,4 @@ toutiao.loginSuccessIndex=http://${toutiao.domain}/index.html
user.welcome=Hello, World!
user.noFilterUrl=/,/login
spring.thymeleaf.cache=false
\ No newline at end of file
......@@ -59,4 +59,4 @@ toutiao.loginSuccessIndex=http://${toutiao.domain}/index.html
user.welcome=Hello, World!
user.noFilterUrl=/,/login
spring.thymeleaf.cache=false
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<title>thymeleaf</title>
</head>
<body>
<h1 th:inline="text">thymeleaf</h1>
<p th:text="${hello}"></p>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册