Springboot整合freemarker
来源:互联网 发布:mysql 命令行导入 编辑:程序博客网 时间:2024/06/05 20:08
Springboot中不推荐使用jsp。所以表现层页面可以使用freemarker来实现。
在pom文件中添加对freemarker启动器的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
模板必须放到src/main/resources/templates目录下。模板扩展名必须为ftl
网页中可能会用到,图片、css、js等静态资源。
需要把静态资源放到src/main/resources下的static目录下
Springboot的部署
Jar包是一个fat jar。其中包含项目要运行使用的所有的jar包。
第一步:在工程的pom.xml中添加以下依赖
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
第二步:可以直接使用maven的命令打成jar包。
mvn package
第三步:java -jar spring-boot-first-0.0.1-SNAPSHOT.jar
在pom文件中添加对freemarker启动器的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
模板必须放到src/main/resources/templates目录下。模板扩展名必须为ftl
网页中可能会用到,图片、css、js等静态资源。
需要把静态资源放到src/main/resources下的static目录下
Springboot的部署
Jar包是一个fat jar。其中包含项目要运行使用的所有的jar包。
第一步:在工程的pom.xml中添加以下依赖
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
第二步:可以直接使用maven的命令打成jar包。
mvn package
第三步:java -jar spring-boot-first-0.0.1-SNAPSHOT.jar
阅读全文
0 0
- springboot整合freemarker
- springboot整合freemarker
- SpringBoot和freemarker整合
- springboot整合freemarker
- SpringBoot整合freemarker
- springboot整合freemarker
- Springboot整合freemarker
- springboot整合jd freemarker
- springboot实战之整合freemarker模版引擎
- springboot系列教程(八)——整合thymeleaf、freemarker
- springboot使用Freemarker继承
- springboot 集成freemarker
- SpringMVC,springboot,freemarker笔记
- springboot+freemarker国际化
- SpringBoot入门-10(springboot配置freemarker模板)
- SpringBoot学习:SpringBoot整合mybatis
- SpringBoot添加freemarker模板引擎
- idea+springboot+freemarker热部署
- springcloud服务已经关闭,但是Eureka还是显示up
- To and Fro(水题)
- mybatis报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sq
- keil编译提示Execution region RW_IRAM1 size (65552 bytes) exceeds limit (65536 bytes). Region contains 16
- NVDIMM原理与应用之四:NVDIMM的数据恢复、使用和监控
- Springboot整合freemarker
- 【最大流 && 映射】POJ
- jstl总结
- 2017.9.23总结1-密码
- react-router 与react-reduct 配合使用时,页面不刷新问题
- C++多态性(二)
- keil调试时数组数值显示truncated
- 实验二 命令行菜单小程序V1.0
- <DP版>codevs 3304 水果姐逛水果街Ⅰ