SpringBoot入门-9(springboot配置thymeleaf模板)
来源:互联网 发布:检查网络是否丢包 编辑:程序博客网 时间:2024/04/25 17:21
系列教程都是从网络上收集和本人的理解所编辑而成,仅供广大爱好者学习所用,请尊重本人的劳动成果。欢迎评论指正和转帖!(请保留连接谢谢!)
一、application.properties
###########################################################datasource -- \u6307\u5b9amysql\u6570\u636e\u5e93\u8fde\u63a5\u4fe1\u606f.########################################################spring.datasource.url = jdbc:mysql://localhost:3306/springboot_testspring.datasource.username = rootspring.datasource.password = fengsispring.datasource.driverClassName = com.mysql.jdbc.Driverspring.datasource.max-active=20spring.datasource.max-idle=8spring.datasource.min-idle=8spring.datasource.initial-size=10########################################################### Java Persistence Api -- Spring jpa\u7684\u914d\u7f6e\u4fe1\u606f.######################################################### Specify the DBMSspring.jpa.database = MYSQL# Show or not log for each sql queryspring.jpa.show-sql = true# Hibernate ddl auto (create, create-drop, update)spring.jpa.hibernate.ddl-auto = update# Naming strategy#[org.hibernate.cfg.ImprovedNamingStrategy #org.hibernate.cfg.DefaultNamingStrategy]spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy# stripped before adding them to the entity manager)spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect########################################################### peizhi ########################################################server.port = 8888#server.context-path = /springboot###########################################################THYMELEAF (ThymeleafAutoConfiguration)#########################################################spring.thymeleaf.prefix=classpath:/templates/#spring.thymeleaf.suffix=.html#spring.thymeleaf.mode=HTML5#spring.thymeleaf.encoding=UTF-8# ;charset=<encoding> is added#spring.thymeleaf.content-type=text/html # set to false for hot refresh#\u5f00\u53d1\u8fc7\u7a0b\u5efa\u8bae\u5173\u95ed\u7f13\u5b58.spring.thymeleaf.cache=false
二、POM.XML
<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/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.fs</groupId><artifactId>springboot_thymeleaf_9</artifactId><packaging>war</packaging><version>0.0.1-SNAPSHOT</version><name>springboot_thymeleaf_9 Maven Webapp</name><url>http://maven.apache.org</url><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.4.1.RELEASE</version></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><!-- 指定一下jdk的版本 ,这里我们使用jdk 1.8 ,默认是1.6 --><java.version>1.8</java.version></properties><dependencies><!-- 添加fastjson 依赖包. --><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.15</version></dependency><!-- spring-boot-starter-web: MVC,AOP的依赖包.... --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><!-- <version></version> 由于我们在上面指定了 parent(spring boot) --></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional><scope>true</scope></dependency><!-- 添加MySQL数据库驱动依赖包. --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><!-- 添加Spring-data-jpa依赖. --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><!-- 添加thymeleaf依赖. --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency></dependencies><build><finalName>springboot_thymeleaf_9</finalName><plugins><!-- 这是spring boot devtool plugin (推荐) --><!--fork : 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart --><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork></configuration></plugin></plugins></build></project>
阅读全文
0 0
- SpringBoot入门-9(springboot配置thymeleaf模板)
- SpringBoot Thymeleaf 模板引擎
- SpringBoot-thymeleaf模板集成
- springboot整合thymeleaf模板
- SpringBoot整合thymeleaf模板
- SpringBoot集成Thymeleaf模板
- SpringBoot入门-14(springboot配置thymeleaf使用YML)
- SpringBoot入门-10(springboot配置freemarker模板)
- SpringBoot入门-11(springboot配置jsp模板)
- SpringBoot-thymeleaf模板语法简介
- springboot webmvc thymeleaf 模板引擎
- SpringBoot使用thymeleaf模板引擎
- SpringBoot整合模板引擎Thymeleaf
- java springboot Thymeleaf模板引擎
- springboot之模板引擎 --- thymeleaf
- springboot中使用thymeleaf模板
- springboot入门之Thymeleaf篇
- springboot web入门之Thymeleaf
- Python-select详解(select、epoll)
- win10 ping不通解决方案
- 删除Linux centos系统下jdk
- 转载:使用Fiddler导致乱码解决方案.
- SVN分支/合并原理及最佳实践
- SpringBoot入门-9(springboot配置thymeleaf模板)
- 测试嵌入式linux设备网口带宽的方法
- PHP常见的设计模式之:观察者模式
- IT 使用单词
- 为什么javascript是单线程的却能让AJAX异步调用?
- 从反人工智能到反无人机,谁在左右科技的进步?
- redis爬坑记(一) redis的安装与启动
- 修改eclipse使用tomcat部署的项目位置
- 产品经理不再纸上谈兵——产品经理需要审时度势