spring_boot_入门级(1)

一、Springboot简介

Springboot框架就用于简化Spring应用的开发,约定大于配置,去繁从简。从以往的“Spring全家桶时代”正式过渡到”Spring boot,J2EE一站式解决方案的时代“,它还可以结合SpringCloud来提供分布式整体的解决方案。

总结一下就是:简化Spring应用的开发的一个框架,整个Spring技术栈的大整合

 从官网的这张图解可以看出Spring提供的分布式整体的解决方案,Springboot用来构建应用,SpringCloud用来处理应用中的互联互调,SpringCloud data用来进行流式计算批处理。

二.环境前的准备

-jdk 1.8以上,-maven 3.5以上,-Intellij IDEA2018,-Springboot 1.5.15

三.案例

首先先使用SpringBoot来实现一个简单的请求,向浏览器发送一条hello请求,应用返回一个Hello Word!!!

 1.打开idea,新建一个SpringInitializr

 

 

 

案例

pom.xml    依赖

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- 引入springboot-mybatis的依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

猜你喜欢

转载自www.cnblogs.com/rzbwyj/p/11984706.html
今日推荐