对接天猫精灵的时候需要有网关服务器方提供几个页面,服务器已经有了,spring boot的 纯后台的,就加了Thymeleaf   jar包添加几个页面跳转

maven配置

        <!-- 引入thymeleaf模板引擎-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependencies>

yml配置

spring:
profiles: shypro
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: LEGACYHTML5
encoding: UTF-8
content-type: text/html
cache: false

在resource下新建templates目录

controller的注解是@Controller,return的string是html的文件名

@Controller
public class HtmlController { @RequestMapping("/testhtml")
public String index(){
System.out.println("index");
return "index";
}
}

html的数据渲染看如下博客

https://www.jianshu.com/p/23bea93e34c7

https://www.jianshu.com/p/a842e5b5012e

Thymeleaf 的语法大全

https://www.cnblogs.com/ityouknow/p/5833560.html

Spring boot +Thymeleaf 搭建springweb的更多相关文章

  1. spring boot + thymeleaf 3 国际化

    在给spring boot 1.5.6 + thymeleaf 3进行国际化时,踩了一个坑(其实不止一个). 现象: 看到了吧, 就是取值的key, 后面被加了_en_US 或 _zh_CN, 以及前 ...

  2. spring boot + Thymeleaf开发web项目

    "Spring boot非常适合Web应用程序开发.您可以轻松创建自包含的HTTP应用.web服务器采用嵌入式Tomcat,或者Jetty等.大多数情况下Web应用程序将使用 spring- ...

  3. Spring Boot+CXF搭建WebService(转)

    概述 最近项目用到在Spring boot下搭建WebService服务,对Java语言下的WebService了解甚少,而今抽个时间查阅资料整理下Spring Boot结合CXF打架WebServi ...

  4. Spring boot+Thymeleaf+easyui集成:js创建组件页面报错

    开发工具:Ideal 使用场景:Demo 前提:       环境:Spring boot +Thymeleaf+easyui 引入thymeleaf模板引擎 <html lang=" ...

  5. spring boot: thymeleaf模板引擎使用

    spring boot: thymeleaf模板引擎使用 在pom.xml加入thymeleaf模板依赖 <!-- 添加thymeleaf的依赖 --> <dependency> ...

  6. Spring Boot 项目学习 (三) Spring Boot + Redis 搭建

    0 引言 本文主要介绍 Spring Boot 中 Redis 的配置和基本使用. 1 配置 Redis 1. 修改pom.xml,添加Redis依赖 <!-- Spring Boot Redi ...

  7. Spring Boot Thymeleaf 实现国际化

    开发传统Java WEB工程时,我们可以使用JSP页面模板语言,但是在SpringBoot中已经不推荐使用了.SpringBoot支持如下页面模板语言 Thymeleaf FreeMarker Vel ...

  8. spring boot + thymeleaf 乱码问题

    spring boot + thymeleaf 乱码问题 hellotrms 发布于 2017/01/17 15:27 阅读 1K+ 收藏 0 答案 1 开发四年只会写业务代码,分布式高并发都不会还做 ...

  9. Spring boot项目搭建及简单实例

    Spring boot项目搭建 Spring Boot 概述 Build Anything with Spring Boot:Spring Boot is the starting point for ...

随机推荐

  1. Ubuntu 18.04 安装配置 go 语言

    Ubuntu 18.04 安装配置 go 语言 1.下载 下载 jdk 到 Downloands 文件夹下 cd 进入 /usr/local, 创建 go 文件夹, 然后 cd 进这个文件夹 cd / ...

  2. Keras结合Keras后端搭建个性化神经网络模型(不用原生Tensorflow)

    Keras是基于Tensorflow等底层张量处理库的高级API库.它帮我们实现了一系列经典的神经网络层(全连接层.卷积层.循环层等),以及简洁的迭代模型的接口,让我们能在模型层面写代码,从而不用仔细 ...

  3. 操作系统-I/O(4)I/O控制方式

    I/O控制的方式分为: 程序直接控制方式(最简单的I/O方式)                   •    无条件传送:对简单外设定时(同步)进行数据传送                   •   ...

  4. 计算机网络-网络层(2)NAT协议

    网络地址转换(NAT,Network Address Translation)协议: 本地网络内通信的IP数据报的源与目的IP地址均在子网10.0.0.0/24内:所有离开本地网络去往Internet ...

  5. 复制一个Python全部环境到另一个环境

    导出此环境下安装的包的版本信息清单  pip freeze > requirements.txt   联网,下载清单中的包到all-packet文件夹 [root@localhost ~]# p ...

  6. Java 获取一段时间内的每一天

    有时候我们会遇到一些业务场景,需要去获取一段时间内的每一天日期 public static List<Date> findDates(Date dBegin, Date dEnd) { L ...

  7. Android开发之将Edittext输入弹出的软键盘设置搜索确定键。详细代码,已验证可用。

    1,首先在布局中添加 android:imeOptions="actionSearch 2,然后java代码中设置代码: et_input_password.setOnEditorActio ...

  8. Maxscript中渲染中文版Vray完成贴图(VrayCompleteMap)的方法

    Objbakeproperties = $.INodeBakeProperties; --选定对象的烘培节点 Prjbakeproperties = $.INodeBakeProjProperties ...

  9. 【C#】静态构造方法与静态变量

    扯下闲篇先,本来今天预计整理下委托.事件.Lamada的笔记,然后再把单例模式的懒汉.饿汉模式看完. 在看到懒汉的双重加锁设计时,向同桌贩卖了下该设计的优点,结果反被同桌的一个问题难倒了~! 一. 有 ...

  10. NGINX 命令 重启 WINDOWS

    最近系统更新比较频繁,web系统老是上新,因此在nginx这边经常需要重启或者刷新,做了一个批命令供参考. 1.鼠标右键-新建-一个.TXT文本文档:在里面输入NGINX重启的命令. 2.输入NGIN ...