自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Spring 6.0 將停止支持 Freemarker 和 JSP

開發(fā) 架構(gòu)
Spring Framework 6.0 第一個里程碑版本已經(jīng)發(fā)布,目前已經(jīng)可以從Spring Repo獲取。這里有一些新變更我們可以提前了解一下。

[[441151]]

Spring Framework 6.0 第一個里程碑版本已經(jīng)發(fā)布,目前已經(jīng)可以從Spring Repo獲取。這里有一些新變更我們可以提前了解一下。

Java EE遷移

甲骨文已經(jīng)把Java EE捐獻(xiàn)給Eclipse基金會數(shù)年了。Java EE的名稱也變更為了Jarkarta EE,包名也相應(yīng)地從javax變更為jakarta。例如javax.persistence現(xiàn)在對應(yīng)為jakarta.persistence。

核心容器

在本次里程碑版本中涉及到的兩個核心容器規(guī)范JSR-250和JSR-330的包名都會遷移到Jakarta EE。

持久層

Jakarta EE的持久層規(guī)范也將在此次里程碑版本中完成遷移。這意味著javax.persistence和jakarta.validation都將實(shí)裝。對應(yīng) Hibernate ORM 5.6.x 和 Hibernate Validator 7.0.x 。

Web 應(yīng)用

Servlet中間件基準(zhǔn)線

由于Jakarta EE的合并遷移,Servlet中間件也要進(jìn)行升級。Tomcat 10, Jetty 11, 或者基于undertow-servlet-jakarta 的 Undertow 2.2.14 是目前里程碑版本的基準(zhǔn)線。

進(jìn)一步移除過時API

一些過時的基于Servlet的組件已經(jīng)在本次里程碑版本中移除。

Commons FileUpload 上傳組件已經(jīng)被移除。

相關(guān)的前后端模板Tiles布局組件例如FreeMarker、JSP停止了支持?,F(xiàn)在Spring將精力放在了基于Restful的Web架構(gòu)。

Controller掃描機(jī)制變動

現(xiàn)在Spring MVC和Spring WebFlux將不再將類上單獨(dú)有@RequestMapping的Spring Bean視為控制器。在6.0之前默認(rèn)情況以下代碼是可以的:

  1. /** 
  2.  * 6.0之前 
  3.  * @author felord.cn 
  4.  */ 
  5. @Component 
  6. @RequestMapping("/foo"
  7. public class FooController { 
  8.  
  9.     @GetMapping("/hello"
  10.     public Map<String, String> hello() { 
  11.         return Collections.singletonMap("hello""world"); 
  12.     } 
  13.  

6.0之前相關(guān)基于AOP的代理機(jī)制將失效, 請為此類控制器啟用基于類的代理 。

在6.0之后默認(rèn)情況下必須有@Controller或@RestController注解才可以被視為控制器。

HttpMethod

請求方法HttpMethod在6.0之前為Java枚舉。

  1. /** 
  2.  *  6.0 之前 
  3.  * 
  4.  * @since 3.0 
  5.  */ 
  6. public enum HttpMethod { 
  7.  
  8.  GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; 
  9.  
  10.  private static final Map<String, HttpMethod> mappings = new HashMap<>(16); 
  11.  
  12.  static { 
  13.   for (HttpMethod httpMethod : values()) { 
  14.    mappings.put(httpMethod.name(), httpMethod); 
  15.   } 
  16.  } 
  17.  
  18.  @Nullable 
  19.  public static HttpMethod resolve(@Nullable String method) { 
  20.   return (method != null ? mappings.get(method) : null); 
  21.  } 
  22.      
  23.  public boolean matches(String method) { 
  24.   return name().equals(method); 
  25.  } 
  26.  

在6.0以后改為Java類:

  1. public final class HttpMethod implements Comparable<HttpMethod>, Serializable { 
  2.  
  3.  private static final long serialVersionUID = -70133475680645360L; 
  4.  
  5.  private static final HttpMethod[] values
  6.  
  7.  private static final Map<String, HttpMethod> mappings = new HashMap<>(16); 
  8.   
  9.  public static final HttpMethod GET = new HttpMethod("GET"); 
  10.   
  11.  public static final HttpMethod HEAD = new HttpMethod("HEAD"); 
  12.   
  13.  public static final HttpMethod POST = new HttpMethod("POST"); 
  14.   
  15.  public static final HttpMethod PUT = new HttpMethod("PUT"); 
  16.    // 其它省略 

其它前沿 

在2022年的1月份Spring Framework 6.0的第二個里程碑和對應(yīng)的Spring Boot 3.0第一個里程碑將和大家見面。

 

責(zé)任編輯:武曉燕 來源: 碼農(nóng)小胖哥
相關(guān)推薦

2009-03-11 10:00:50

Windows 7VB

2022-05-23 09:48:47

Rails 3RubyMine升級

2014-09-12 09:32:37

2010-04-29 14:13:50

Oracle Lust

2011-12-31 08:52:20

IE7Facebook

2010-04-12 17:26:15

Windows Vis

2021-07-09 14:24:14

Google PlayJelly BeanAPI

2022-06-15 09:09:48

VME開發(fā)者驅(qū)動程序

2020-11-04 08:16:30

Windows10

2021-04-27 15:35:00

Microsoft.Net Framew開發(fā)人員

2013-02-18 09:21:32

Windows 7

2021-04-27 09:40:43

微軟.NET Framew應(yīng)用

2023-03-05 21:22:27

開源FFmpeg

2015-10-26 13:16:11

FreeMarkerJSP

2015-10-28 10:04:29

FreeMarkerJSP

2009-06-17 16:14:22

Spring 3.0全

2017-11-16 13:49:26

NumPyPython 2核心團(tuán)隊(duì)

2021-04-28 17:39:03

區(qū)塊鏈加密貨幣穩(wěn)定幣

2009-05-11 10:27:32

Spring Batc配置工作劃分

2009-07-06 10:02:22

JSP Servlet
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號