spring boot(一):入门
Spring Boot的优点
Spring Boot 是伴随着 Spring 4.0 诞生的,从字面理解,Boot是引导的意思,因此 Spring Boot 旨在帮助开发者快速搭建 Spring 框架。Spring Boot 继承了原有 Spring 框架的优秀基因,使 Spring 在使用中更加方便快捷。

嵌入的 Tomcat 、 Jetty 或者 Undertow,无须部署 WAR 文件:
配置Ecplise的Spring Boot开发环境
Unregistering JMX-exposed beans on shutdown
解决办法:去除 <scope>provided</scope>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
To display the auto-configuration report re-run your application with 'debug' enabled.
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
pom.xml
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.7.Final</version>
</dependency>
Spring环境配置(安装springsource-tool-suite插件)及第一个Spring HelloWorld
[spring boot][thymeleaf]spring boot 1.5+ 页面无法找到
<properties>
<!--
springboot 默认使用thymeleaf的2.0,即:spring-boot-starter-thymeleaf中包含的是thymeleaf2.X
springboot1.5.2+需要使用thymeleaf3.X。手动去配置
-->
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>
</properties>
@Controller返回试图 @RestController返回Json

spring boot热部署,pom需要添加以下的配置:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
Spring Boot 的配置文件及多环境配置
Profile 是 Spring 用来针对不同的环境对不同的配置提供支持的,全局 Profile 配置使用 application-{profile}. yml(如 application-prod.yml)。
通过在 application.yml 中设置 spring.profiles.active = prod 来指定活动的 Profile。
依次再目录下面新建三个配置文件,application-dev.yml、application-test.yml、application-prod.yml。它们分别代表开发环境、测试环境、生产环境的配置文件。
项目设计

本项目用到的技术和框架
项目构建: maven
web框架:spring boot
数据库ORM:mybatis
数据库连接池:Druid
分页插件:PageHelper
数据库:mysql
缓存NOSQL:redis
前端模板:thymeleaf
文章展示:使用commonmark,将markdown转成html页面
资料
http://springboot.fun/
http://spring.io/tools/sts/all
http://blog.csdn.net/q649381130/article/details/77875736
https://www.cnblogs.com/superfj/p/9044532.html
spring boot(一):入门的更多相关文章
- Spring Boot 快速入门
Spring Boot 快速入门 http://blog.csdn.net/xiaoyu411502/article/details/47864969 今天给大家介绍一下Spring Boot MVC ...
- Spring Boot快速入门(二):http请求
原文地址:https://lierabbit.cn/articles/4 一.准备 postman:一个接口测试工具 创建一个新工程 选择web 不会的请看Spring Boot快速入门(一):Hel ...
- Spring Boot -01- 快速入门篇(图文教程)
Spring Boot -01- 快速入门篇(图文教程) 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到[慕课网]手机 app ...
- spring boot入门教程——Spring Boot快速入门指南
Spring Boot已成为当今最流行的微服务开发框架,本文是如何使用Spring Boot快速开始Web微服务开发的指南,我们将使创建一个可运行的包含内嵌Web容器(默认使用的是Tomcat)的可运 ...
- Spring Boot 从入门到实战汇总
之前写过几篇spring boot入门到实战的博文,因为某些原因没能继续. 框架更新迭代很快,之前还是基于1.x,现在2.x都出来很久了.还是希望能从基于该框架项目开发的整体有一个比较系统的梳理,于是 ...
- Spring Boot从入门到精通(二)配置GitHub并上传Maven项目
简单介绍一下GitHub,它是一个面向开源及私有软件项目的托管平台,因为只支持git作为唯一的版本库格式进行托管,故名GitHub. GitHub于2008年4月10日正式上线,除了Git代码仓库托管 ...
- Spring Boot从入门到精通(五)多数据源配置实现及源码分析
多数据源配置在项目软件中是比较常见的开发需求,Spring和Spring Boot中对此都有相应的解决方案可供大家参考.在Spring Boot中,如MyBatis.JdbcTemplate以及Jpa ...
- Spring Boot从入门到精通(六)集成Redis实现缓存机制
Redis(Remote Dictionary Server ),即远程字典服务,是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言 ...
- Spring Boot从入门到精通(七)集成Redis实现Session共享
单点登录(SSO)是指在多个应用系统中,登录用户只需要登录验证一次就可以访问所有相互信任的应用系统,Redis Session共享是实现单点登录的一种方式.本文是通过Spring Boot框架集成Re ...
- Spring Boot从入门到精通(八)日志管理实现和配置信息分析
Spring Boot对日志的处理,与平时我们处理日志的方式完全一致,它为Java Util Logging.Log4J2和Logback提供了默认配置.对于每种日志都预先配置使用控制台输出和可选的文 ...
随机推荐
- 【IdentityServer4文档】- 使用密码保护 API
使用密码保护 API OAuth 2.0 协议允许资源拥有者给客户端密码授权:客户端向令牌服务发送用户密码,以获取代表该用户的访问令牌. 该规范建议仅将“资源所有者密码授予”用于“可信”(或旧版)应用 ...
- Nodejs学习笔记(二)--- 操作MongoDB数据库
最近看了一些关于mongodb的文章,然后就想知道nodeJS是怎么连接的所以我就尝试去了解了一波(这个菜鸟驿站这个网站还不错,虽然知识文档不是最新的,但是还是蛮好的: 顺便官网地址是这个哦:http ...
- Struts2:Struts2在jsp中使用标签时值的获取
在OGNL的使用中,需要访问一系列的对象,这些对象放在OGNL的context中,context是一个Map结构,实际上它和ActionContext是相应的. 当用户发送请求时,struts会创建A ...
- [hook.js]通用Javascript函数钩子及其他
2013.02.16<:article id=post_content> 最近看Dom Xss检测相关的Paper,涉及到Hook Javascript函数,网上翻了一下,貌似没有什么通用 ...
- erlang访问https地址
参考How do I do an HTTPS request with Erlang? 1> application:start(inets). ok 2> application:sta ...
- 设计模式PHP篇(三)————装饰器模式
简单的用php实现了装饰器模式: <?php /** *简单的装饰器模式 */ class PrintText { protected $decorators = []; public func ...
- 【Nginx】转:Nginx try_files
原来的配置是这样的: location / { try_files $uri $uri/ /index.php; index index.html index.htm index.php; } loc ...
- 使用salt-cloud创建虚拟机
salt-cloud也是基于openstack来做的,它可以支持多种云的使用.比如:Aliyun.Azure.DigitalOcean.EC2.Google Compute Engine.HP Clo ...
- 学习websocket-SignalR,MVC中使用SignalR打造酷炫实用的即时通讯
http://www.cnblogs.com/Leo_wl/p/4793284.html http://www.fangsi.net/archives/1144.html
- codeforces 1027 E. Inverse coloring (DP)
E. Inverse Coloring time limit per test 2 seconds memory limit per test 256 megabytes input standard ...