zoukankan      html  css  js  c++  java
  • Springboot 框架学习

    Springboot 框架学习

    前言

    Spring Boot是Spring 官方的顶级项目之一,她的其他小伙伴还有Spring CloudSpring FrameworkSpring Data等等。

    简介

    Spring Boot可以轻松创建单独的,基于生产级的Spring应用程序,您需要做的可能“仅仅是去运行”。 我们提供了Spring Platform对Spring 框架和第三方库进行处理,尽可能的降低使用的复杂度。大多数情况下Spring Boot应用只需要非常少的配置。

    Features(她的特点)

    • Create stand-alone Spring applications
    • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
      快速构建独立的Spring Application,使用内嵌容器,无需部署到外部容器,你要做的仅仅是运行她。
    • Provide opinionated 'starter' POMs to simplify your Maven configuration
    • Automatically configure Spring whenever possible
      提供众多扩展的‘starter’,通过依赖探知自动配置,你要做的仅仅是添加Maven依赖。
    • Provide production-ready features such as metrics, health checks and externalized configuration
      提供生产环境下的性能健康状态监控及外部化配置,让你时刻掌控她。
    • Absolutely no code generation and no requirement for XML configuration
      无需生成代码及XML配置,一切从简。

    通过上面官网的描述,其实我总结下来就两条:

    • ** 依赖探知,自动配置**
    • 一切从简,Just Run !

      尝试

      1. 配置你项目的pom.xml
      <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
      </parent>
      <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
      </dependencies>
      
      1. 创建Application.java
      @RestController
      @EnableAutoConfiguration
      public class Application {
      
          @RequestMapping("/")
          String index() {
              return "Welcome to know Spring Boot !";
          }
      
          public static void main(String[] args) throws Exception {
              SpringApplication.run(Application.class, args);
          }
      }
      
      1. Just Run,执行Application.main() 或者 mvn:spring-boot:run
        启动成功后,访问http://localhost:8080/

      可能仅仅不到1分钟便可快速构建、部署、启动一个Web 应用,这就是Spring Boot ~

      Springboot 详细的学习资料
    • https://segmentfault.com/a/1190000008539153
    
    
  • 相关阅读:
    通过字符串调用函数
    First,FirstOrDefault和Single,SingleOrDefault 的区别
    asp循环例子
    将il文件和资源文件生成dll工具
    C# 修改资源文件工具ResourceNet4
    北京ip
    实验1、Mininet 源码安装和可视化拓扑工具
    实验2:Mininet 实验——拓扑的命令脚本生成
    ajax post data 获取不到数据,注意 contenttype的设置 、post/get
    调试提示:当前不会命中断点
  • 原文地址:https://www.cnblogs.com/Fairy-02-11/p/8158863.html
Copyright © 2011-2022 走看看