<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Spring 5 的新功能和增強功能 > 原文: [https://howtodoinjava.com/spring5/spring5-features-and-enhancements/](https://howtodoinjava.com/spring5/spring5-features-and-enhancements/) **Spring 5** 是第一個主要版本,距 Spring Framework 4.0 差不多四年了。 在此期間,大多數增強功能都是在 [Spring boot](https://howtodoinjava.com/spring/spring-boot/spring-boot-tutorial-with-hello-world-example/) 項目中完成的。 在本文中,我們將快速介紹 Spring 5.0 發行版中的一些令人興奮的功能。 ## 基準升級 要構建和運行 Spring 5 應用程序,您將需要最低 [JDK 8](https://howtodoinjava.com/java-8-tutorial/) 和 Java EE7。不再支持以前的 JDK 和 Java EE 版本。 詳細來說,Java EE 7 包括: * Servlet 3.1 * [JMS 2.0](https://howtodoinjava.com/spring/spring-boot/spring-boot-jmstemplate-activemq/) * [JPA 2.1](https://howtodoinjava.com/jpa-tutorials-and-examples/) * [JAX-RS 2.0](https://restfulapi.net/create-rest-apis-with-jax-rs-2-0/) * [Bean 驗證 1.1](https://howtodoinjava.com/spring/spring-mvc/spring-bean-validation-example-with-jsr-303-annotations/) 與 Java 基準相似,許多其他框架的基準也有所變化。 例如 * Hibernate 5 * Jackson 2.6 * EhCache 2.10 * [JUnit 5](https://howtodoinjava.com/junit-5-tutorial/) * Tiles 3 另外,記下各種服務器的最低支持版本。 * Tomcat 8.5 以上 * Jetty 9.4+ * WildFly 10+ * Netty 4.1+ * Undertow 1.4 以上 ## JDK 9 運行時兼容性 Spring 5 發行版與 [JDK 9](https://howtodoinjava.com/java9/java9-new-features-enhancements/) 發行日期非常吻合。 我們的目標是讓 Spring Framework 5.0 在 JDK 9 的 GA 之后立即成為 GA。 Spring 5.0 的候選版本已經在類路徑以及 [modulepath](https://howtodoinjava.com/java9/java-9-modules-tutorial/) 上支持 Java 9。 您可以期望在 GA 版本中獲得良好的 JDK 9 支持。 ## JDK 8 功能的用法 在 Spring 4.3 之前,JDK 的基線版本為 6。因此 Spring 4 必須支持 Java 6、7 和 8。為了保持向后兼容性,Spring 框架并沒有采用 Java 8 本身帶來的許多新功能,例如。 [Lambda 編程](https://howtodoinjava.com/java8/complete-lambda-expressions-tutorial-in-java/)。 Spring 5 具有基準版本 8,因此它也使用 Java 8 和 9 的許多新功能。 例如 1. Spring 核心接口中的 Java 8 [默認方法](https://howtodoinjava.com/java8/default-methods-in-java-8/) 2. 基于 Java 8 反射增強的內部代碼改進 3. 在框架代碼中使用功能編程-lambda 和[流](https://howtodoinjava.com/java8/java-8-tutorial-streams-by-examples/) ## 響應式編程支持 [響應式編程](https://howtodoinjava.com/rxjava/rxjava-2-0-tutorial/)是 Spring Framework 5.0 的最重要功能之一。 響應式編程提供了另一種編程風格,專注于構建對事件做出反應的應用程序。 Spring Framework 5 包含響應式流(用于定義響應式 API 的中性語言嘗試)和 [Reactor](https://projectreactor.io/) (由 Spring Pivotal 團隊提供的響應式流的 Java 實現),用于其自身的響應式使用以及其許多核心 API。 Spring Web Reactive 位于新的`spring-web-reactive`模塊中,位于`spring-webmvc`模塊中現有(流行的!)Spring Web MVC 的旁邊。 請注意,在 Spring 5 中,傳統的 Spring MVC 可以在任何 Servlet 3.1 堆棧上運行,包括 Java EE 7 服務器。 ## 功能性網絡框架 在響應功能的基礎上,Spring 5 還提供了一個功能性的 Web 框架。 它提供了使用功能性編程風格定義端點的功能。 該框架引入了兩個基本組件:`HandlerFunction`和`RouterFunction`。 `HandlerFunction`代表處理傳入請求并生成響應的功能。 `RouterFunction`可以替代`@RequestMapping`注解。 用于將傳入的請求路由到處理函數。 例如 ```java RouterFunction<String> route = route(GET("/hello-world"), request -> Response.ok().body(fromObject("Hello World"))); ``` ## Kotlin 支持 [Kotlin](https://kotlinlang.org/) 是一種靜態類型的 JVM 語言,它使代碼具有表達力,簡短性和可讀性。 Spring framework 5.0 對 Kotlin 有很好的支持。 ## 功能移除 隨著 Java,Java EE 和其他一些框架的基準版本的增加,Spring Framework 5 刪除了對一些框架的支持。 例如 * Portlet * Velocity * JasperReports * XMLBeans * JDO * Guava 學習愉快! 參考:[鏈接](https://github.com/spring-projects/spring-framework/wiki/What's-New-in-the-Spring-Framework#whats-new-in-spring-framework-5x)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看