zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    Server Tomcat v8.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
    用户画像——“打标签”
    python replace函数替换无效问题
    python向mysql插入数据一直报TypeError: must be real number,not str
    《亿级用户下的新浪微博平台架构》读后感
    【2-10】标准 2 维表问题
    【2-8】集合划分问题(给定要分成几个集合)
    【2-7】集合划分问题
    【2-6】排列的字典序问题
    【2-5】有重复元素的排列问题
  • 原文地址:https://www.cnblogs.com/rzbwyj/p/11984706.html
Copyright © 2011-2022 走看看