SpringBoot入门-10(springboot配置freemarker模板)
来源:互联网 发布:java mvc框架 编辑:程序博客网 时间:2024/04/25 15:17
系列教程都是从网络上收集和本人的理解所编辑而成,仅供广大爱好者学习所用,请尊重本人的劳动成果。欢迎评论指正和转帖!(请保留连接谢谢!)
一、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 = 8080#server.context-path = /springboot###########################################################FREEMARKER (FreeMarkerAutoConfiguration)########################################################spring.freemarker.allow-request-override=falsespring.freemarker.cache=falsespring.freemarker.check-template-location=truespring.freemarker.charset=UTF-8spring.freemarker.content-type=text/htmlspring.freemarker.expose-request-attributes=falsespring.freemarker.expose-session-attributes=falsespring.freemarker.expose-spring-macro-helpers=false#spring.freemarker.prefix=#spring.freemarker.request-context-attribute=#spring.freemarker.settings.*=spring.freemarker.suffix=.ftl#spring.freemarker.template-loader-path=classpath:/templates/ #comma-separated list#spring.freemarker.view-names= # whitelist of view names that can be resolved
二、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_freemarker_10</artifactId><packaging>war</packaging><version>0.0.1-SNAPSHOT</version><name>springboot_freemarker_10 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><!-- 添加freemarker依赖. --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-freemarker</artifactId></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency></dependencies><build><finalName>springboot_freemarker_10</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入门-10(springboot配置freemarker模板)
- SpringBoot入门-9(springboot配置thymeleaf模板)
- SpringBoot入门-11(springboot配置jsp模板)
- SpringBoot入门-15(springboot配置freemarker使用YML)
- SpringBoot添加freemarker模板引擎
- 【springboot】自定义模板配置
- SpringBoot 入门与配置
- springboot采用FreeMarker模板集成应用
- springboot +nginx +freemarker 模板的简单集成
- Springboot模板引擎之Freemarker篇
- SpringBoot使用FreeMarker模板发送邮件
- SpringBoot入门-13(springboot配置使用YML)
- Springboot 配置通用文件模板
- springboot学习之配置入门
- springboot整合freemarker
- springboot使用Freemarker继承
- springboot整合freemarker
- SpringBoot和freemarker整合
- python 与浏览器接口换行问题
- 制作login.jsp页面,要求实现提供用户登陆的界面, 用户通过该界面输入用户名(控件名userName)和密码(控件名password), 然后点击“登录”按钮实现登陆操作.
- redis 删除key下特定内容
- 秒杀多线程第七篇 经典线程同步 互斥量Mutex
- Ubuntu下搭建Git服务器
- SpringBoot入门-10(springboot配置freemarker模板)
- TextInputLayout的使用
- 自动释放linux内存
- python初学--用map规范英文名字
- MVP框架介绍
- 获取安卓设备上有线网或者无线网络的IP地址
- 开源测试报告框架-allure
- 自动生成.gitignore
- 三行代码,让你的桌面图标再也不会被打乱