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>

  • 相关阅读:
    Win2000下系统进程隐藏代码
    关于Windows下ShellCode编写的一点思考
    木马是如何编写的(三)
    MS04011远程缓冲区溢出代码
    关于Windows下ShellCode编写的一点思考
    木马是如何编写的(三)
    运用GIMP制作平面图片
    PCMan File Manager:标签式的文件解决软件
    AutoMySQLBackup——主动备份 MySQL 数据库的剧本
    ubuntu8.04下USB转UART接口的应用
  • 原文地址:https://www.cnblogs.com/rzbwyj/p/11984706.html
Copyright © 2011-2022 走看看