【Spring Boot 文檔翻譯】開始使用 Spring Boot

這個部分也非常簡單,主要介紹了 Spring Boot 特點,怎麼安裝,對系統的要求以及開發第一個Spring Boot應用。

Spring Boot簡介

Spring Boot能根據開發者添加的jar包依賴,自動配置相應的Bean,從而大大減少開發者手動的配置。內嵌容器,不需要另外部署到傳統的Tomcat這種容器中。
因此Spring Boot能讓用戶迅速開發基於Spring的應用,儘可能減少繁瑣的Spring配置,提升開發者的開發體驗和開發效率。

支持的Servlet容器

基於Spring Boot開發的應用,不需要我們自己安裝Servlet容器。支持的內置容器有:

  • Tomcat 9.0版本
  • Jetty 9.4版本
  • Undertow 2.0版本

需要 Java8 和 Spring Framework 5.2.6 以上的支持。

最簡單的Spring Boot應用

//只需要給主應用類加上@SpringBootApplication註解就可以
@SpringBootApplication
public class App {

private static Logger logger = LoggerFactory.getLogger(App.class);
public static void main(String[] args) {

    SpringApplication app = new SpringApplication();
    SpringApplication.run(App.class,args);
    logger.info("app start success...");
    }
}

版本遷移

If you are upgrading from an earlier release of Spring Boot, check the “migration guide” on the project
wiki that provides detailed upgrade instructions. Check also the “release notes” for a list of “new and
noteworthy” features for each release.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章