您的当前位置:首页什么是SpringBoot简介

什么是SpringBoot简介

来源:锐游网
什么是SpringBoot简介

1.什么是spring boot

  简单的说,spring boot就是整合了很多优秀的框架,不⽤我们⾃⼰⼿动的去写⼀堆xml配置然后进⾏配置。

  从本质上来说,Spring Boot就是Spring,它做了那些没有它你也会去做的Spring Bean配置。它使⽤“习惯优于配置”(项⽬中存在⼤量的配置,此外还内置了⼀个习惯性的配置,让你⽆需⼿动进⾏配置)的理念让你的项⽬快速运⾏起来。使 ⽤Spring Boot很容易创建⼀个独⽴运⾏(运⾏jar,内嵌Servlet容器)、准⽣产级别的基于Spring框架的项⽬,使⽤Spring Boot你可以不⽤或者只需要很少的Spring配置。

Spring Boot精要

Spring将很多魔法带⼊了Spring应⽤程序的开发之中,其中最重要的是以下四个核⼼。

⾃动配置:针对很多Spring应⽤程序常见的应⽤功能,Spring Boot能⾃动提供相关配置起步依赖:告诉Spring Boot需要什么功能,它就能引⼊需要的库。

命令⾏界⾯:这是Spring Boot的可选特性,借此你只需写代码就能完成完整的应⽤程序,⽆需传统项⽬构建。Actuator:让你能够深⼊运⾏中的Spring Boot应⽤程序,⼀探究竟。  动态语⾔:不需要编译,直接运⾏,⽐如JS。  静态语⾔:先编译再运⾏。

  配置指的是xml配置,低下的开发效率指的是编写完代码之后需要进⾏⼤量的xml配置,但是单从写代码⽽⾔,Java开发效率还是⽐较⾼的,因为有许多写好的第三⽅jar包。

  微服务:将⼦系统拆成⼀个⼀个的jar包运⾏就是微服务。

2.优缺点

---------------------------第⼆种认识------------------------- 现在的web项⽬⼏乎都会⽤到spring框架,⽽要使⽤spring难免需要配置⼤量的xml配置⽂件,⽽ springboot的出现解 决了这⼀问题,⼀个项⽬甚⾄不⽤部署到服务器上直接开跑,真像springboot所说:“just run”。 springboot的很多默认编码⽅式都是utf-8,真是福利啊。

org.spring 2013年新开发的框架springboot , 它让⼀个单独项⽬的创建变得更加的简单,让所有依赖spring的程序可以做到“justrun”。springboot提供⼤量第三⽅libraries让我们可以⾮常轻松的开始创建⼀个spring⼯程,甚⾄不需要再去配置⼀些繁琐的 xml配置⽂件

框架特点:

1:创建独⽴的spring应⽤。

2:嵌⼊Tomcat, Jetty Undertow ⽽且不需要部署他们。 3:提供的“starters”poms来简化Maven配置 4:尽可能⾃动配置spring应⽤。 5:提供⽣产指标,健壮检查和外部化配置 6:绝对没有代码⽣成和XML配置要求

2.SpringBoot运⾏环境

Spring Boot最新版可以运⾏在Java6+的环境下,但是Spring官⽅建议使⽤Java8。Servlet 容器

NameTomcat 8Tomcat 7Jetty 9Jetty 8

Servlet VersionJava Version3.13.03.13.0

Java 7+Java 6+Java 7+Java 6+Java 7+

Undertow 1.13.1

3.pringBoot⽀持哪些应⽤

使⽤SpringBoot可以快速创建普通Java项⽬和Web项⽬,以及其他项⽬。Spring Boot application starters

Name

spring-boot-starterspring-boot-starter-actuatorspring-boot-starter-amqpspring-boot-starter-aopspring-boot-starter-artemisspring-boot-starter-batchspring-boot-starter-cachespring-boot-starter-cloud-connectors

spring-boot-starter-data-elasticsearch

spring-boot-starter-data-gemfirespring-boot-starter-data-jpaspring-boot-starter-data-mongodb

spring-boot-starter-data-redisspring-boot-starter-data-restspring-boot-starter-data-solrspring-boot-starter-freemarkerspring-boot-starter-groovy-templates

spring-boot-starter-hateoasspring-boot-starter-hornetqspring-boot-starter-integrationspring-boot-starter-jdbcspring-boot-starter-jerseyspring-boot-starter-jta-atomikosspring-boot-starter-jta-bitronixspring-boot-starter-mailspring-boot-starter-mobilespring-boot-starter-mustachespring-boot-starter-securityspring-boot-starter-social-facebook

spring-boot-starter-social-linkedin

spring-boot-starter-social-twitterspring-boot-starter-testspring-boot-starter-thymeleafspring-boot-starter-velocity

Description

The core Spring Boot starter, including auto-configuration support, logging and YAML.Production ready features to help you monitor and manage your application.Support for the “Advanced Message Queuing Protocol” via spring-rabbit.Support for aspect-oriented programming including spring-aop and AspectJ.Support for “Java Message Service API” via Apache Artemis.Support for “Spring Batch” including HSQLDB database.Support for Spring’s Cache abstraction.

Support for “Spring Cloud Connectors” which simplifies connecting to services in cloud platforms like CloudFoundry and Heroku.

Support for the Elasticsearch search and analytics engine including spring-data-elasticsearch.Support for the GemFire distributed data store including spring-data-gemfire.

Support for the “Java Persistence API” including spring-data-jpa, spring-orm and Hibernate.Support for the MongoDB NoSQL Database, including spring-data-mongodb.Support for the REDIS key-value data store, including spring-data-redis.

Support for exposing Spring Data repositories over REST via spring-data-rest-webmvc.Support for the Apache Solr search platform, including spring-data-solr.Support for the FreeMarker templating engine.Support for the Groovy templating engine.

Support for HATEOAS-based RESTful services via spring-hateoas.Support for “Java Message Service API” via HornetQ.Support for common spring-integration modules.Support for JDBC databases.

Support for the Jersey RESTful Web Services framework.Support for JTA distributed transactions via Atomikos.Support for JTA distributed transactions via Bitronix.Support for javax.mail.Support for spring-mobile.

Support for the Mustache templating engine.Support for spring-security.Support for spring-social-facebook.Support for spring-social-linkedin.Support for spring-social-twitter.

Support for common test dependencies, including JUnit, Hamcrest and Mockito along with the spring-testmodule.

Support for the Thymeleaf templating engine, including integration with Spring.Support for the Velocity templating engine.

spring-boot-starter-webNamespring-boot-starter-websocketspring-boot-starter-ws

Support for full-stack web development, including Tomcat and spring-webmvc.DescriptionSupport for WebSocket development.Support for Spring Web Services.

因篇幅问题不能全部显示,请点此查看更多更全内容

Top