1.什麼是spring bootjava
簡單的說,spring boot就是整合了不少優秀的框架,不用咱們本身手動的去寫一堆xml配置而後進行配置。
web
從本質上來講,Spring Boot就是Spring,它作了那些沒有它你也會去作的Spring Bean配置。它使用「習慣優於配置」(項目中存在大量的配置,此外還內置了一個習慣性的配置,讓你無需手動進行配置)的理念讓你的項目快速運行起來。使 用Spring Boot很容易建立一個獨立運行(運行jar,內嵌Servlet容器)、準生產級別的基於Spring框架的項目,使用Spring Boot你能夠不用或者只須要不多的Spring配置。redis
Spring將不少魔法帶入了Spring應用程序的開發之中,其中最重要的是如下四個核心。spring
動態語言:不須要編譯,直接運行,好比JS。mongodb
靜態語言:先編譯再運行。springboot
配置指的是xml配置,低下的開發效率指的是編寫完代碼以後須要進行大量的xml配置,可是單從寫代碼而言,Java開發效率仍是比較高的,由於有許多寫好的第三方jar包。服務器
微服務:將子系統拆成一個一個的jar包運行就是微服務。websocket
2.優缺點mvc
---------------------------第二種認識-------------------------app
1 . springboot簡單介紹(http://projects.spring.io/spring-boot/)
如今的web項目幾乎都會用到spring框架,而要使用spring不免須要配置大量的xml配置文件,而 springboot的出現解 決了這一問題,一個項目甚至不用部署到服務器上直接開跑,真像springboot所說:「just run」。
springboot的不少默認編碼方式都是utf-8,真是福利啊。
org.spring 2013年新開發的框架springboot , 它讓一個單獨項目的建立變得更加的簡單,讓全部依賴spring的程序能夠作到「just run」。springboot提供大量第三方libraries讓咱們能夠很是輕鬆的開始建立一個spring工程,甚至不須要再去配置一些繁瑣的 xml配置文件
框架特色:
1:建立獨立的spring應用。
2:嵌入Tomcat, Jetty Undertow 並且不須要部署他們。
3:提供的「starters」poms來簡化Maven配置
4:儘量自動配置spring應用。
5:提供生產指標,健壯檢查和外部化配置
6:絕對沒有代碼生成和XML配置要求
Spring Boot最新版能夠運行在Java6+的環境下,可是Spring官方建議使用Java8。
Servlet 容器
Name | Servlet Version | Java Version |
---|---|---|
Tomcat 8 | 3.1 | Java 7+ |
Tomcat 7 | 3.0 | Java 6+ |
Jetty 9 | 3.1 | Java 7+ |
Jetty 8 | 3.0 | Java 6+ |
Undertow 1.1 | 3.1 | Java 7+ |
使用SpringBoot能夠快速建立普通Java項目和Web項目,以及其餘項目。
Spring Boot application starters
Name | Description |
---|---|
spring-boot-starter |
The core Spring Boot starter, including auto-configuration support, logging and YAML. |
spring-boot-starter-actuator |
Production ready features to help you monitor and manage your application. |
spring-boot-starter-amqp |
Support for the 「Advanced Message Queuing Protocol」 via spring-rabbit. |
spring-boot-starter-aop |
Support for aspect-oriented programming including spring-aop and AspectJ. |
spring-boot-starter-artemis |
Support for 「Java Message Service API」 via Apache Artemis. |
spring-boot-starter-batch |
Support for 「Spring Batch」 including HSQLDB database. |
spring-boot-starter-cache |
Support for Spring’s Cache abstraction. |
spring-boot-starter-cloud-connectors |
Support for 「Spring Cloud Connectors」 which simplifies connecting to services in cloud platforms like Cloud Foundry and Heroku. |
spring-boot-starter-data-elasticsearch |
Support for the Elasticsearch search and analytics engine including spring-data-elasticsearch. |
spring-boot-starter-data-gemfire |
Support for the GemFire distributed data store including spring-data-gemfire. |
spring-boot-starter-data-jpa |
Support for the 「Java Persistence API」 including spring-data-jpa, spring-orm and Hibernate. |
spring-boot-starter-data-mongodb |
Support for the MongoDB NoSQL Database, including spring-data-mongodb. |
spring-boot-starter-data-redis |
Support for the REDIS key-value data store, including spring-data-redis. |
spring-boot-starter-data-rest |
Support for exposing Spring Data repositories over REST via spring-data-rest-webmvc. |
spring-boot-starter-data-solr |
Support for the Apache Solr search platform, including spring-data-solr. |
spring-boot-starter-freemarker |
Support for the FreeMarker templating engine. |
spring-boot-starter-groovy-templates |
Support for the Groovy templating engine. |
spring-boot-starter-hateoas |
Support for HATEOAS-based RESTful services via spring-hateoas. |
spring-boot-starter-hornetq |
Support for 「Java Message Service API」 via HornetQ. |
spring-boot-starter-integration |
Support for common spring-integration modules. |
spring-boot-starter-jdbc |
Support for JDBC databases. |
spring-boot-starter-jersey |
Support for the Jersey RESTful Web Services framework. |
spring-boot-starter-jta-atomikos |
Support for JTA distributed transactions via Atomikos. |
spring-boot-starter-jta-bitronix |
Support for JTA distributed transactions via Bitronix. |
spring-boot-starter-mail |
Support for javax.mail. |
spring-boot-starter-mobile |
Support for spring-mobile. |
spring-boot-starter-mustache |
Support for the Mustache templating engine. |
spring-boot-starter-security |
Support for spring-security. |
spring-boot-starter-social-facebook |
Support for spring-social-facebook. |
spring-boot-starter-social-linkedin |
Support for spring-social-linkedin. |
spring-boot-starter-social-twitter |
Support for spring-social-twitter. |
spring-boot-starter-test |
Support for common test dependencies, including JUnit, Hamcrest and Mockito along with the spring-testmodule. |
spring-boot-starter-thymeleaf |
Support for the Thymeleaf templating engine, including integration with Spring. |
spring-boot-starter-velocity |
Support for the Velocity templating engine. |
spring-boot-starter-web |
Support for full-stack web development, including Tomcat and spring-webmvc. |
spring-boot-starter-websocket |
Support for WebSocket development. |
spring-boot-starter-ws |
Support for Spring Web Services. |