主頁 > 後端開發 > SpringMVC執行流程及原始碼分析

SpringMVC執行流程及原始碼分析

2021-03-07 06:11:01 後端開發

SpringMVC流程及原始碼分析

前言

? 學了一遍SpringMVC以后,想著做一個總結,復習一下,復習寫下面的總結的時候才發現,其實自己學的并不徹底、牢固、也沒有學全,視頻跟書本是要結合起來一起,每一位老師的視頻可能提到的東西都不一致,也導致也不是很全面,書本上會講的筆記系統、全面,同時我自己也是一個初學者,下面總結的可能并不完善、正確,希望看到的大神給我指出,在此非常感謝,


目錄
  • SpringMVC流程及原始碼分析
  • 一 、Spring核心模塊
    • 1、核心模塊
    • 2、Spring版本命名規則(補充)
  • 二、SpringMVC流程及原理
    • 1、執行流程
      • 1.1、執行流程
      • 1.2、執行流程說明:
        • 1.2.1、第02、03說明
        • 1.2.2、第04說明
        • 1.2.2、SpringMVC組件說明
        • 1.2.3、SpringMVC詳細流程圖
  • 二、原始碼分析
    • 1、初始化
      • 1.1、ApplicationContext
    • 2、前端控制器(中央處理器)DistepcherServlet
      • 2.1、查找處理器映射器HandlerMapping
      • 2.2、根據處理器映射器HandlerMapping回傳結果呼叫處理器配接器HandlerAdapter
      • 2.3、檢查攔截器Interceptor
      • 2.3、處理器配接器HandlerAdapter執行Handler(Controller)回傳ModelAndView
      • 2.4、視圖決議器ViewResolver
      • 2.5、視圖View
        • 2.5.1、視圖物件的作用
        • 2.5.2、View介面圖
        • 2.5.3、View的實作類圖
        • 2.5.4、View的UML圖
        • 2.5.5、常用的View視圖類
      • 2.6、其他重要的點
        • 2.6.1、DispatcherServlet.properties
  • 三、參考參考資料
    • 1、參考資料
    • 2、參考資料

一 、Spring核心模塊

1、核心模塊

? Spring Web MVC (下文簡稱為 SpringMVC )是 Spring 提供 Web 應用的框架設計,屬于表現層的框架,SpringMVC是Spring框架的一部分,
Spring框架包括大致六大模塊,核心容器(Core Container)、AOP和設備支持、資料訪問及集成、Web、報文發送、Test

2021022601-01-Spring5核心模塊圖解

圖片來源于Spring官網5.0.0.M5:

? https://docs.spring.io/spring-framework/docs/5.0.0.M5/spring-framework-reference/html/overview.html#overview-modules

對于Spring5模塊圖,有2點疑問:
1、不清楚為什么在Spring官網上5.0版本以后,Release版(穩定版)的都未找到模塊圖,但是在M(里程碑版)版找到 了,如果有人在5.0以后的Release版(穩定版)找到,麻煩給我留個言,謝謝,
2、在其他博文中看到Spring5模塊結構圖是這樣的:

2021022601-02-Spring5核心模塊圖解-疑問

挺奇怪這個圖是哪里來的?(路過的大神請指點)

對于問題2,我在Spring5.2.13.RELEASE GA中,找到了如下所示資訊:

2021022601-03-Spring5核心模塊圖解-5.2.13.RELEASE

拷貝以上資訊:

Spring Framework Documentation

Version 5.2.13.RELEASE

What’s New, Upgrade Notes, Supported Versions, and other topics, independent of release cadence, are maintained externally on the project’s Github Wiki.

Overview history, design philosophy, feedback, getting started.
Core IoC Container, Events, Resources, i18n, Validation, Data Binding, Type Conversion, SpEL, AOP.
Testing Mock Objects, TestContext Framework, Spring MVC Test, WebTestClient.
Data Access Transactions, DAO Support, JDBC, O/R Mapping, XML Marshalling.
Web Servlet Spring MVC, WebSocket, SockJS, STOMP Messaging.
Web Reactive Spring WebFlux, WebClient, WebSocket.
Integration Remoting, JMS, JCA, JMX, Email, Tasks, Scheduling, Caching.
Languages Kotlin, Groovy, Dynamic Languages.

按照以上資訊的Web Servlet、Web Reactive已經是分屬于不同的模塊了,

  • Web Servlet:Spring MVC, WebSocket, SockJS, STOMP Messaging.
  • Web Reactive:Spring WebFlux, WebClient, WebSocket.

Spring官方檔案:https://spring.io/projects/spring-framework#learn/

2、Spring版本命名規則(補充)

上面提到了Spring又不同的版本,在此記錄一下各個版本的意義,

描述方式 說明 含義
Snapshot 快照版 尚不穩定,仍處于開發中的版本
Release 穩定版 功能相對穩定,可以對外發行,但有時間限制
GA 正式版 代表廣泛可用的穩定版(General Availability)
M 里程碑版 (M是Milestone的意思)具有一些全新的功能或是有意義的版本
RC 終測版 Release Candidate(最終測驗),即將作為正式版發布

二、SpringMVC流程及原理

1、執行流程

SpringMVC執行流程圖
2021022601-04-魯班學院-springmvc流程圖-2清晰點圖片來源:三、參考參考資料

1.1、執行流程

  • 01、用戶發送出請求到前端控制器(中央處理器)DispatcherServlet進行處理,

  • 02、前端控制器DispatcherServlet收到請求后,呼叫處理器映射器HandlerMapping,

  • 03、處理器映射器HandlerMapping(處理器映射器)根據request請求的URL等資訊查找能夠進行處理的Handler,以及相關攔截器interceptor,并構造HandlerExecutionChain執行鏈,然后將構造好的HandlerExecutionChain執行鏈物件回傳給前端控制器DispatcherServlet,

  • 04、前端控制器DispatcherServlet根據處理器映射器HandlerMapping的

  • 05、處理器配接器HandlerAdapter經過適配呼叫具體的處理器(Handler/Controller),即業務中自己寫的Controller,

  • 06、Controller處理完后回傳ModelAndView(springmvc的封裝物件,將model和view封裝在一起)給處理器配接器HandlerAdapter;

  • 07、處理器配接器HandlerAdapter將Controller執行結果ModelAndView回傳給前端控制器DispatcherServlet,

  • 08、前端控制器DispatcherServlet呼叫視圖決議器ViewReslover處理ModelAndView,

  • 09、視圖決議器ViewReslover決議后根據邏輯視圖名決議成物理視圖名即具體的頁面地址,生成并回傳具體物件View(springmvc封裝物件,是一個介面),

  • 10、前端控制器DispatcherServlet根據物件View進行視圖渲染,填充Model,

  • 11、前端控制器DispatcherServlet向用戶回傳回應

1.2、執行流程說明:

1.2.1、第02、03說明

(1) 處理器映射器:springmvc框架中的一種物件,框架把實作了HandlerMapping介面的類都叫做映射器(多個);

(2) 處理器映射器作用:根據請求,從springmvc容器物件中獲取處理器物件(MyController controller = ctx.getBean("some")

(3) 框架把找到的處理器物件放到一個叫做處理器執行鏈(HandlerExecutionChain)的類保存

(4) HandlerExecutionchain:類中保存著
?a:處理器物件(MyController);
?b:專案中的所有的攔截器List

(5) 方法呼叫:HandlerExecutionChain mappedHandler - getHandler (processedRequest);

1.2.2、第04說明

(1) HandlerExecutionChain執行鏈找到對應的處理器映射器HandlerAdapter,
(2) 處理器配接器:springmvc框架中的物件,需要實作HandlerAdapter介面,
(3) 處理器配接器作用:執行處理器方法(呼叫MyController.doSome()得到回傳值ModelAndView )
(4) 前端控制器中呼叫配接器:HandlerAdapter ha =getHandlerAdapter (mappedHandler.getHandler());
(5) 執行處理器方法:mv= ha.handle (processedRequest, response, mappedHandler.getHandler());

第08說明:
(1) 視圖決議器:springmvc中的物件,需要實作ViewResoler介面(可以有多個)
(2) 視圖決議器作用:組成視圖完整路徑,使用前綴,后綴,并創建View物件,
(3) view是一個介面,表示視圖的,在框架中jsp,htm1不是string表示,而是使用view和他的實作類表示視圖,

InternalResourceview:視圖類,表示jsp檔案,視圖決議器會創建InternalResourceView類物件, 這個物件的里面,有一個屬性url-/WEB-INF/view/show.jsp

1.2.2、SpringMVC組件說明

  • (1). 前端控制器(DispatcherServlet):接收請求,回應結果,相當于電腦的CPU,
  • (2). 處理器映射器(HandlerMapping):根據URL去查找處理器.
  • (3). 處理器(Handler):(需要程式員去寫代碼處理邏輯的).
  • (4). 處理器配接器(HandlerAdapter):會把處理器包裝成配接器,這樣就可以支持多種型別的處理器,類比筆記本的配接器(配接器模式的應用).
  • (5). 視圖決議器(ViewResovler):進行視圖決議,多回傳的字串,進行處理,可以決議成對應的頁面.

1.2.3、SpringMVC詳細流程圖

綜上所述,總結下SpringMVC的詳細流程圖:

2021022601-05-springmvc流程圖-詳細
圖片來源:三、參考參考資料

二、原始碼分析

以下原始碼來源jar包:spring-webmvc-5.25.RELEASE.jar

1、初始化

1.1、ApplicationContext

? ApplicationContext初始化入口類:ApplicationObjectSupport的setApplicationContext方法,setApplicationContext方法中核心部分就是初始化容器initApplicationContext(context),子類AbstractDetectingUrlHandlerMapping實作了該方法,
類圖:
2021022601-06-RequestMappingHandlerMapping類層次圖
UML圖:
2021022601-07-RequestMappingHandlerMapping-uml
? RequestMappingHandlerMapping ,用于注解@Controller,@RequestMapping來定義controller.
初始化時,3個類的大致分工如下:

  • AbstractHandlerMethodMapping定義整個演算法流程;
  • RequestMappingInfoHandlerMapping提供匹配條件RequestMappingInfo的決議處理;
  • RequestMappingHandlerMapping根據@RequestMapping注解生成 RequestMappingInfo,同時提供isHandler實作

2、前端控制器(中央處理器)DistepcherServlet

? 從上面的流程圖可以看到前端控制器(中央處理器)DistepcherServlet是SpringMVC核心,查看DistepcherServlet類的繼承情況,
UML圖:
![2021022601-08-DispatcherServlet UML圖](https://gitee.com/chuchq/blogs-gallery/raw/master/images / 2021/2021022601-08-DispatcherServlet UML圖.png)
從繼承關系看出:
? DistepcherServlet ---> FrameworkServlet ---> HttpServletBean---> HttpServlet
? 那就說明DistepcherServlet 類也是一個Servlet類,那最終核心的方法就是service()方法,即Servlet的核心方法,
? 那就找service()方法,在DistepcherServlet中沒有servic()方法,在父類FrameworkServlet有service()方法,原始碼如下:
來源:

org.springframework.web.servlet.FrameworkServlet.service(HttpServletRequest request, HttpServletResponse response)

/**
	 * Override the parent class implementation in order to intercept PATCH requests.
	 */
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpMethod httpMethod = HttpMethod.resolve(request.getMethod());
		if (httpMethod == HttpMethod.PATCH || httpMethod == null) {
			processRequest(request, response);
		}
		else {
			super.service(request, response);
		}
	}

可以看到:
FrameworkServlet.service(HttpServletRequest request, HttpServletResponse response)拿到request請求,判斷當前請求是否是PATCH請求,不是的就呼叫父類的servic()方法,掉用父類中的service方法就是去呼叫該類中doPost(),doGet()方法,根據不同的請求方式然后走doPost()或者doGet(),呼叫中以doGet()為例,
FrameworkServlet類的doGet()原始碼:

/**
	 * Delegate GET requests to processRequest/doService.
	 * <p>Will also be invoked by HttpServlet's default implementation of {@code doHead},
	 * with a {@code NoBodyResponse} that just captures the content length.
	 * @see #doService
	 * @see #doHead
	 */
	@Override
	protected final void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		processRequest(request, response);
	}

? doGet()又呼叫FrameworkServlet類中的processRequest(request, response);

/**
	 * Process this request, publishing an event regardless of the outcome.
	 * <p>The actual event handling is performed by the abstract
	 * {@link #doService} template method.
	 */
	protected final void processRequest(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		long startTime = System.currentTimeMillis();
		Throwable failureCause = null;

		LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
		LocaleContext localeContext = buildLocaleContext(request);

		RequestAttributes previousAttributes = RequestContextHolder.getRequestAttributes();
		ServletRequestAttributes requestAttributes = buildRequestAttributes(request, response, previousAttributes);

		WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
		asyncManager.registerCallableInterceptor(FrameworkServlet.class.getName(), new RequestBindingInterceptor());

		initContextHolders(request, localeContext, requestAttributes);

		try {
			doService(request, response);
		}
		catch (ServletException | IOException ex) {
			failureCause = ex;
			throw ex;
		}
		catch (Throwable ex) {
			failureCause = ex;
			throw new NestedServletException("Request processing failed", ex);
		}

		finally {
			resetContextHolders(request, previousLocaleContext, previousAttributes);
			if (requestAttributes != null) {
				requestAttributes.requestCompleted();
			}
			logResult(request, response, failureCause, asyncManager);
			publishRequestHandledEvent(request, response, startTime, failureCause);
		}
	}

? processRequest(request, response)方法中最關鍵的又呼叫了doService(request, response);查看FrameworkServlet類中的doService(request, response),或者是除錯跟蹤可知,doService(request, response)由子類DispatcherServlet實作,

原始碼來源:

org.springframework.web.servlet.FrameworkServlet.doService(HttpServletRequest request, HttpServletResponse response)

/**
	 * Subclasses must implement this method to do the work of request handling,
	 * receiving a centralized callback for GET, POST, PUT and DELETE.
	 * <p>The contract is essentially the same as that for the commonly overridden
	 * {@code doGet} or {@code doPost} methods of HttpServlet.
	 * <p>This class intercepts calls to ensure that exception handling and
	 * event publication takes place.
	 * @param request current HTTP request
	 * @param response current HTTP response
	 * @throws Exception in case of any kind of processing failure
	 * @see javax.servlet.http.HttpServlet#doGet
	 * @see javax.servlet.http.HttpServlet#doPost
	 */
	protected abstract void doService(HttpServletRequest request, HttpServletResponse response)
			throws Exception;

? 查看DispatcherServlet中的doService(HttpServletRequest request, HttpServletResponse response)方法

/**
	 * Exposes the DispatcherServlet-specific request attributes and delegates to {@link #doDispatch}
	 * for the actual dispatching.
	 */
	@Override
	protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
		logRequest(request);

		// Keep a snapshot of the request attributes in case of an include,
		// to be able to restore the original attributes after the include.
		Map<String, Object> attributesSnapshot = null;
		if (WebUtils.isIncludeRequest(request)) {
			attributesSnapshot = new HashMap<>();
			Enumeration<?> attrNames = request.getAttributeNames();
			while (attrNames.hasMoreElements()) {
				String attrName = (String) attrNames.nextElement();
				if (this.cleanupAfterInclude || attrName.startsWith(DEFAULT_STRATEGIES_PREFIX)) {
					attributesSnapshot.put(attrName, request.getAttribute(attrName));
				}
			}
		}

		// Make framework objects available to handlers and view objects.
		request.setAttribute(WEB_APPLICATION_CONTEXT_ATTRIBUTE, getWebApplicationContext());
		request.setAttribute(LOCALE_RESOLVER_ATTRIBUTE, this.localeResolver);
		request.setAttribute(THEME_RESOLVER_ATTRIBUTE, this.themeResolver);
		request.setAttribute(THEME_SOURCE_ATTRIBUTE, getThemeSource());

		if (this.flashMapManager != null) {
			FlashMap inputFlashMap = this.flashMapManager.retrieveAndUpdate(request, response);
			if (inputFlashMap != null) {
				request.setAttribute(INPUT_FLASH_MAP_ATTRIBUTE, Collections.unmodifiableMap(inputFlashMap));
			}
			request.setAttribute(OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
			request.setAttribute(FLASH_MAP_MANAGER_ATTRIBUTE, this.flashMapManager);
		}

		try {
			doDispatch(request, response);
		}
		finally {
			if (!WebAsyncUtils.getAsyncManager(request).isConcurrentHandlingStarted()) {
				// Restore the original attribute snapshot, in case of an include.
				if (attributesSnapshot != null) {
					restoreAttributesAfterInclude(request, attributesSnapshot);
				}
			}
		}
	}

? DispatcherServlet的doService()方法中最終呼叫doDispatch(request, response),查看原始碼如下:
org.springframework.web.servlet.DispatcherServlet.doDispatch()

/**
	 * Process the actual dispatching to the handler.
	 * <p>The handler will be obtained by applying the servlet's HandlerMappings in order.
	 * The HandlerAdapter will be obtained by querying the servlet's installed HandlerAdapters
	 * to find the first that supports the handler class.
	 * <p>All HTTP methods are handled by this method. It's up to HandlerAdapters or handlers
	 * themselves to decide which methods are acceptable.
	 * @param request current HTTP request
	 * @param response current HTTP response
	 * @throws Exception in case of any kind of processing failure
	 */
	protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
		HttpServletRequest processedRequest = request;
		HandlerExecutionChain mappedHandler = null;
		boolean multipartRequestParsed = false;

		WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);

		try {
			ModelAndView mv = null;
			Exception dispatchException = null;

			try {
				// 檔案上傳相關,判斷是不是二進制請求
				processedRequest = checkMultipart(request);
				multipartRequestParsed = (processedRequest != request);
				// 取得處理當前請求的controller,這里也稱為hanlder處理器,第一個步驟的意義就在這里體現了.這里并不是直接回傳controller,而是回傳的HandlerExecutionChain請求處理器鏈物件,該物件封裝了handler和攔截器interceptors.
				// Determine handler for the current request.
				mappedHandler = getHandler(processedRequest);
				// 如果handler為空,則回傳404
				if (mappedHandler == null) {
					noHandlerFound(processedRequest, response);
					return;
				}
				//3. 獲取處理request的處理器配接器HandlerAdapter
				// Determine handler adapter for the current request.
				HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());

				// Process last-modified header, if supported by the handler.
				String method = request.getMethod();
				boolean isGet = "GET".equals(method);
				if (isGet || "HEAD".equals(method)) {
					long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
					if (new ServletWebRequest(request, response).checkNotModified(lastModified) && isGet) {
						return;
					}
				}
				//處理器配接器執行之前,檢查攔截器的方法
				if (!mappedHandler.applyPreHandle(processedRequest, response)) {
					return;
				}
				//處理器配接器根據找到,執行handler,回傳ModelAndView
				// Actually invoke the handler.
				mv = ha.handle(processedRequest, response, mappedHandler.getHandler());

				if (asyncManager.isConcurrentHandlingStarted()) {
					return;
				}

				applyDefaultViewName(processedRequest, mv);
				mappedHandler.applyPostHandle(processedRequest, response, mv);
			}
			catch (Exception ex) {
				dispatchException = ex;
			}
			catch (Throwable err) {
				// As of 4.3, we're processing Errors thrown from handler methods as well,
				// making them available for @ExceptionHandler methods and other scenarios.
				dispatchException = new NestedServletException("Handler dispatch failed", err);
			}
			processDispatchResult(processedRequest, response, mappedHandler, mv, dispatchException);
		}
		catch (Exception ex) {
			triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
		}
		catch (Throwable err) {
			triggerAfterCompletion(processedRequest, response, mappedHandler,
					new NestedServletException("Handler processing failed", err));
		}
		finally {
			if (asyncManager.isConcurrentHandlingStarted()) {
				// Instead of postHandle and afterCompletion
				if (mappedHandler != null) {
					mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response);
				}
			}
			else {
				// Clean up any resources used by a multipart request.
				if (multipartRequestParsed) {
					cleanupMultipart(processedRequest);
				}
			}
		}
	}

? 可以看出doDispatch()就是SpringMVC的核心代碼了,分析doDispatch():

2.1、查找處理器映射器HandlerMapping

? 首先看下處理器映射器HandlerMapping類圖:
2021022601-09-HandlerMapping類圖

doDispatch()關鍵代碼:

HandlerExecutionChain mappedHandler = null;

mappedHandler = getHandler(processedRequest);

? mappedHandler是一個執行鏈HandlerExecutionChain 物件,這里封裝了handler和攔截器interceptors,getHandler(processedRequest)方法就是從處理器映射器HandlerMapping中找到url和controller的對應關系,并回傳給前端控制器DispatchServlet,
查看getHandler(processedRequest);原始碼:

/**
	 * Return the HandlerExecutionChain for this request.
	 * <p>Tries all handler mappings in order.
	 * @param request current HTTP request
	 * @return the HandlerExecutionChain, or {@code null} if no handler could be found
	 */
	@Nullable
	protected HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
		if (this.handlerMappings != null) {
			for (HandlerMapping mapping : this.handlerMappings) {
				HandlerExecutionChain handler = mapping.getHandler(request);
				if (handler != null) {
					return handler;
				}
			}
		}
		return null;
	}

除錯代碼如下:
2021022601-10-DispatchServlet-doDispatch-getHandler執行截圖
從代碼除錯中可以看到handlerMapping中有三個物件:

this.handlerMappings = {ArrayList@4662}  size = 3
 0 = {BeanNameUrlHandlerMapping@4791} 
 1 = {RequestMappingHandlerMapping@4792} 
 2 = {RouterFunctionMapping@4793} 
  • BeanNameUrlHandlerMapping:初始化時會將urlpath做映射存盤(xml);

  • RequestMappingHandlerMapping:初始化時會將Controller中配置@RequestMapping注解的方法做映射存盤(注解);

  • RouterFunctionMapping:
    (這個物件不是太理解)
    這也就是為什么要去HandlerMapping找一個Handler了,因為處理器映射器HandlerMapping有不同的實作:

  • 1、xml方式

  • 2、注解方式

接著看getHandler(HttpServletRequest request)方法,先遍歷HandlerMappers,查找控制器找到之后就回傳執行鏈HandlerExecutionChain型別的Handler,

2021022601-11-DispatchServlet-doDispatch-getHandler-執行截圖

可以看到回傳的Handler中,拿到的就是我們自己編碼的Controller類,以及攔截器(演示專案中未撰寫,所以除錯匯總回傳的Handler最后是0 interceptors)
HandlerExecutionChain with [com.bjpowernode.controller.MyController#doSome()] and 0 interceptors
2021022601-12-02-DispatchServlet-doDispatch-getHandler-mappedHandler執行截圖2
將正在除錯的idea打開自己撰寫的Controller來對照,發現一致:
2021022601-13-DispatchServlet-doDispatch-getHandler-執行回傳結果截圖

2.2、根據處理器映射器HandlerMapping回傳結果呼叫處理器配接器HandlerAdapter

doDispatch()里面的關鍵代碼:

HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());

原始碼如下:

/**
	 * Return the HandlerAdapter for this handler object.
	 * @param handler the handler object to find an adapter for
	 * @throws ServletException if no HandlerAdapter can be found for the handler. This is a fatal error.
	 */
	protected HandlerAdapter getHandlerAdapter(Object handler) throws ServletException {
		if (this.handlerAdapters != null) {
			for (HandlerAdapter adapter : this.handlerAdapters) {
				if (adapter.supports(handler)) {
					return adapter;
				}
			}
		}
		throw new ServletException("No adapter for handler [" + handler +
				"]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler");
	}

為什么還要獲取處理器配接器HandlerAdapter:與獲取處理器映射器HandlerMapping一樣,Spring提供了不通的處理器配接器,
除錯如下:

2021022601-14-01-DispatchServlet-doDispatch-getHandlerAdapter-執行截圖-出方法-在用
查看DEBUG除錯模式中getHandlerAdapter()方法在中的:
handler、adapter、this.handlerAdapters

2021022601-15-DispatchServlet-doDispatch-getHandlerAdapter-執行結果截圖
以下是拷貝的結果:
handler

handler = {HandlerMethod@4792} "com.bjpowernode.controller.MyController#doSome()"
 logger = {LogAdapter$JavaUtilLog@4858} 
 bean = {MyController@4859} 
 beanFactory = {DefaultListableBeanFactory@4847} "org.springframework.beans.factory.support.DefaultListableBeanFactory@56b5a4c3: defining beans [myController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; root of factory hierarchy"
 beanType = {Class@3782} "class com.bjpowernode.controller.MyController"
 method = {Method@4860} "public org.springframework.web.servlet.ModelAndView com.bjpowernode.controller.MyController.doSome()"
 bridgedMethod = {Method@4860} "public org.springframework.web.servlet.ModelAndView com.bjpowernode.controller.MyController.doSome()"
 parameters = {MethodParameter[0]@4861} 
 responseStatus = null
 responseStatusReason = null
 resolvedFromHandlerMethod = {HandlerMethod@4863} "com.bjpowernode.controller.MyController#doSome()"
 interfaceParameterAnnotations = null
 description = "com.bjpowernode.controller.MyController#doSome()"

adapter

adapter = {RequestMappingHandlerAdapter@4827} 
 customArgumentResolvers = null
 argumentResolvers = {HandlerMethodArgumentResolverComposite@4833} 
 initBinderArgumentResolvers = {HandlerMethodArgumentResolverComposite@4834} 
 customReturnValueHandlers = null
 returnValueHandlers = {HandlerMethodReturnValueHandlerComposite@4835} 
 modelAndViewResolvers = null
 contentNegotiationManager = {ContentNegotiationManager@4836} 
 messageConverters = {ArrayList@4837}  size = 4
 requestResponseBodyAdvice = {ArrayList@4838}  size = 0
 webBindingInitializer = null
 taskExecutor = {SimpleAsyncTaskExecutor@4839} 
 asyncRequestTimeout = null
 callableInterceptors = {CallableProcessingInterceptor[0]@4840} 
 deferredResultInterceptors = {DeferredResultProcessingInterceptor[0]@4842} 
 reactiveAdapterRegistry = {ReactiveAdapterRegistry@4844} 
 ignoreDefaultModelOnRedirect = false
 cacheSecondsForSessionAttributeHandlers = 0
 synchronizeOnSession = false
 sessionAttributeStore = {DefaultSessionAttributeStore@4845} 
 parameterNameDiscoverer = {DefaultParameterNameDiscoverer@4846} 
 beanFactory = {DefaultListableBeanFactory@4847} "org.springframework.beans.factory.support.DefaultListableBeanFactory@56b5a4c3: defining beans [myController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; root of factory hierarchy"
 sessionAttributesHandlerCache = {ConcurrentHashMap@4848}  size = 0
 initBinderCache = {ConcurrentHashMap@4849}  size = 0
 initBinderAdviceCache = {LinkedHashMap@4850}  size = 0
 modelAttributeCache = {ConcurrentHashMap@4851}  size = 0
 modelAttributeAdviceCache = {LinkedHashMap@4852}  size = 0
 order = 2147483647
 supportedMethods = null
 allowHeader = "GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS"
 requireSession = false
 cacheControl = null
 cacheSeconds = -1
 varyByRequestHeaders = null
 useExpiresHeader = false
 useCacheControlHeader = true
 useCacheControlNoStore = true
 alwaysMustRevalidate = false
 servletContext = {ApplicationContextFacade@4754} 
 logger = {LogAdapter$JavaUtilLog@4854} 
 applicationContext = {XmlWebApplicationContext@4665} "WebApplicationContext for namespace 'myweb-servlet', started on Tue Mar 02 23:25:35 CST 2021"
 messageSourceAccessor = {MessageSourceAccessor@4855} 

this.handlerAdapters

this.handlerAdapters = {ArrayList@4658}  size = 4
 0 = {HttpRequestHandlerAdapter@4810} 
 1 = {SimpleControllerHandlerAdapter@4820} //XML方式
 2 = {RequestMappingHandlerAdapter@4827} //注解方式
 3 = {HandlerFunctionAdapter@4832} 

可以看到找到4個處理器配接器,通過DEBUG模式可以看到,此次取到的處理器配接器HandlerAdapter是:RequestMappingHandlerAdapter

ha = {RequestMappingHandlerAdapter@4827} 

2.3、檢查攔截器Interceptor

doDispatch()中的關鍵代碼:

if (!mappedHandler.applyPreHandle(processedRequest, response)) {
					return;
				}
org.springframework.web.servlet.HandlerExecutionChain#applyPreHandle

applyPreHandle(processedRequest, response)原始碼:

/**
	 * Apply preHandle methods of registered interceptors.
	 * @return {@code true} if the execution chain should proceed with the
	 * next interceptor or the handler itself. Else, DispatcherServlet assumes
	 * that this interceptor has already dealt with the response itself.
	 */
	boolean applyPreHandle(HttpServletRequest request, HttpServletResponse response) throws Exception {
		HandlerInterceptor[] interceptors = getInterceptors();
		if (!ObjectUtils.isEmpty(interceptors)) {
			for (int i = 0; i < interceptors.length; i++) {
				HandlerInterceptor interceptor = interceptors[i];
				if (!interceptor.preHandle(request, response, this.handler)) {
					triggerAfterCompletion(request, response, null);
					return false;
				}
				this.interceptorIndex = i;
			}
		}
		return true;
	}

2.3、處理器配接器HandlerAdapter執行Handler(Controller)回傳ModelAndView

doDispatch()中的關鍵代碼:

mv = ha.handle(processedRequest, response, mappedHandler.getHandler());

DEBUG模式除錯,是跳到了:
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter#handle
原始碼如下:

/**
	 * This implementation expects the handler to be an {@link HandlerMethod}.
	 */
	@Override
	@Nullable
	public final ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {

		return handleInternal(request, response, (HandlerMethod) handler);
	}

再往下看handleInternal(request, response, (HandlerMethod) handler)方法,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#handleInternal

@Override
	protected ModelAndView handleInternal(HttpServletRequest request,
			HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {

		ModelAndView mav;
		checkRequest(request);

		// Execute invokeHandlerMethod in synchronized block if required.
		if (this.synchronizeOnSession) {
			HttpSession session = request.getSession(false);
			if (session != null) {
				Object mutex = WebUtils.getSessionMutex(session);
				synchronized (mutex) {
					mav = invokeHandlerMethod(request, response, handlerMethod);
				}
			}
			else {
				// No HttpSession available -> no mutex necessary
				mav = invokeHandlerMethod(request, response, handlerMethod);
			}
		}
		else {
			// No synchronization on session demanded at all...
			mav = invokeHandlerMethod(request, response, handlerMethod);
		}

		if (!response.containsHeader(HEADER_CACHE_CONTROL)) {
			if (getSessionAttributesHandler(handlerMethod).hasSessionAttributes()) {
				applyCacheSeconds(response, this.cacheSecondsForSessionAttributeHandlers);
			}
			else {
				prepareResponse(response);
			}
		}

		return mav;
	}

注意,handleInternal(request, response, (HandlerMethod) handler)方法的回傳值是ModelAndView ,這里就完成了處理器配接器HandlerAdapter執行Handler(Controller)并將結果ModelAndView回傳給前端控制器DistepchServlet

2.4、視圖決議器ViewResolver

??接上2.3:前端控制器DistepchServlet接收到處理器配接器HandlerAdapter回傳的ModelAndView以后,這里分2種情況:

  • (1)、如果ModelAndView里面是邏輯視圖
    前端控制器DistepchServlet呼叫視圖決議器ViewResolver通過邏輯視圖查找真正的視圖物件View,并回傳給前端控制器DistepchServlet,
  • (2)、如果ModelAndView里面是非邏輯視圖:
    如:MappingJackson2JsonView(把當前資料轉為為JSON資料,并不需要對視圖邏輯名稱進行轉換)

總結一下:
視圖決議器ViewResolver介面主要作用是決議前端控制器DispatcherServlet傳遞的邏輯視圖名,并將決議結果的真正的視圖物件View傳回給前端控制器DispatcherServlet

ViewResolverd的實作類:

2021022601-16-ViewResolver-實作類圖-hierarchy
ViewResolver的UML:

2021022601-17-ViewResolver-uml圖

2.5、視圖View

2.5.1、視圖物件的作用

  • (1)、將控制器回傳的資料處理渲染,最侄訓傳客戶端展示給用戶,主要就是完成轉發或者是重定向的操作.,
  • (2)、為了實作視圖模型和具體實作技術的解耦(指的是Spring在org.springframework.web.servlet包中定義的抽象View介面),詳見2.5.2View介面圖,
  • (3)、視圖物件View由視圖決議器負責實體化,由于視圖是無狀態(每一次請求都會創建一個新的view物件)的,所以不會有執行緒安全的問題.

2.5.2、View介面圖

2021022601-18-View-介面方法

2.5.3、View的實作類圖

2021022601-19-View-實作類圖-hierarchy

2.5.4、View的UML圖

![2021022601-20-01-View-uml(hierarchic group layout)](https://gitee.com/chuchq/blogs-gallery/raw/master/images / 2021/2021022601-20-01-View-uml(hierarchic group layout).png)

2.5.5、常用的View視圖類

視圖型別 簡介
URL視圖資源圖 InternalResourceView 將JSP或其他資源封裝成一個視圖,被視圖決議器InternalResourceViewResolver默認使用,
JstlView InternalResourceView的子類,如果JSP中使用了JSTL的國際化標簽,就需要使用該視圖類,
檔案視圖 AbstractExcelView Excel檔案視圖的抽象類,
AbstractPdfView PDF檔案視圖的抽象類
報表視圖 ConfigurableJasperReportsView 常用的JasperReports報表視圖
JasperReportsHtmlView
JasperReportsPdfView
JasperReportsXlsView
JSON視圖 MappingJackson2JsonView 將資料通過Jackson框架的ObjectMapper物件,以JSON方式輸出

2.6、其他重要的點

2.6.1、DispatcherServlet.properties

DispatcherServlet.properties檔案是在SpringMVC架包中:
2021022601-21-jar-DispatchServlet.properties
DispatcherServlet.properties內容:

# Default implementation classes for DispatcherServlet's strategy interfaces.
# Used as fallback when no matching beans are found in the DispatcherServlet context.
# Not meant to be customized by application developers.

org.springframework.web.servlet.LocaleResolver=
	org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver

org.springframework.web.servlet.ThemeResolver=
	org.springframework.web.servlet.theme.FixedThemeResolver

org.springframework.web.servlet.HandlerMapping=
	org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,\
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping,\
	org.springframework.web.servlet.function.support.RouterFunctionMapping

org.springframework.web.servlet.HandlerAdapter=
	org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,\
	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,\
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter,\
	org.springframework.web.servlet.function.support.HandlerFunctionAdapter


org.springframework.web.servlet.HandlerExceptionResolver=
	org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver,\
	org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver,\
	org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver

org.springframework.web.servlet.RequestToViewNameTranslator=
	org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator

org.springframework.web.servlet.ViewResolver=
	org.springframework.web.servlet.view.InternalResourceViewResolver

org.springframework.web.servlet.FlashMapManager=
	org.springframework.web.servlet.support.SessionFlashMapManager

SpringMVC為什么能加載不同處理器映射器HandlerMapping、處理器配接器handlerAdapter,就是因為框架配置了這個DispatcherServlet.properties檔案,

三、參考參考資料

1、參考資料

  • SpringMVC流程圖參考地址:https://www.iqiyi.com/w_19s2gmyazh.html

  • SpringMVC流程圖參考地址2:https://blog.csdn.net/win7system/article/details/90674757

  • View視圖作用參考地址:https://blog.csdn.net/qq_43193797/article/details/84928603

  • Spring官方檔案:https://spring.io/projects/spring-framework#learn/

    在寫此文的時候可能還有少部分是參考了其他資料,但是整理的時候我已經找不到原文出處了,如果原文作者看到,請及時聯系我,我在文章中加上參考出處,謝謝!

2、參考資料

  • 參考:w3cschool-Spring MVC 4.2.4.RELEASE 中文檔案:

    https://www.w3cschool.cn/spring_mvc_documentation_linesh_translation/

  • 參考:https://www.cnblogs.com/leftthen/category/790002.html


免責宣告:
本文中使用的部分圖片來自于網路(地址見:三、參考參考資料),如有侵權,請聯系博主進行洗掉,

轉載宣告:

? 寫博客不易,請尊重原作者!!

? 歡迎大家閱讀、轉載,如果是整文轉載請在文章開頭或者結尾處 注明 原文地址、作者,如果是大段參考備注 參考鏈接

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/266895.html

標籤:Java

上一篇:表格邏輯的幾個想法

下一篇:Java泛型

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 【C++】Microsoft C++、C 和匯編程式檔案

    ......

    uj5u.com 2020-09-10 00:57:23 more
  • 例外宣告

    相比于斷言適用于排除邏輯上不可能存在的狀態,例外通常是用于邏輯上可能發生的錯誤。 例外宣告 Item 1:當函式不可能拋出例外或不能接受拋出例外時,使用noexcept 理由 如果不打算拋出例外的話,程式就會認為無法處理這種錯誤,并且應當盡早終止,如此可以有效地阻止例外的傳播與擴散。 示例 //不可 ......

    uj5u.com 2020-09-10 00:57:27 more
  • Codeforces 1400E Clear the Multiset(貪心 + 分治)

    鏈接:https://codeforces.com/problemset/problem/1400/E 來源:Codeforces 思路:給你一個陣列,現在你可以進行兩種操作,操作1:將一段沒有 0 的區間進行減一的操作,操作2:將 i 位置上的元素歸零。最終問:將這個陣列的全部元素歸零后操作的最少 ......

    uj5u.com 2020-09-10 00:57:30 more
  • UVA11610 【Reverse Prime】

    本人看到此題沒有翻譯,就附帶了一個自己的翻譯版本 思考 這一題,它的第一個要求是找出所有 $7$ 位反向質數及其質因數的個數。 我們應該需要質數篩篩選1~$10^{7}$的所有數,這里就不慢慢介紹了。但是,重讀題,我們突然發現反向質數都是 $7$ 位,而將它反過來后的數字卻是 $6$ 位數,這就說明 ......

    uj5u.com 2020-09-10 00:57:36 more
  • 統計區間素數數量

    1 #pragma GCC optimize(2) 2 #include <bits/stdc++.h> 3 using namespace std; 4 bool isprime[1000000010]; 5 vector<int> prime; 6 inline int getlist(int ......

    uj5u.com 2020-09-10 00:57:47 more
  • C/C++編程筆記:C++中的 const 變數詳解,教你正確認識const用法

    1、C中的const 1、區域const變數存放在堆疊區中,會分配記憶體(也就是說可以通過地址間接修改變數的值)。測驗代碼如下: 運行結果: 2、全域const變數存放在只讀資料段(不能通過地址修改,會發生寫入錯誤), 默認為外部聯編,可以給其他源檔案使用(需要用extern關鍵字修飾) 運行結果: ......

    uj5u.com 2020-09-10 00:58:04 more
  • 【C++犯錯記錄】VS2019 MFC添加資源不懂如何修改資源宏ID

    1. 首先在資源視圖中,添加資源 2. 點擊新添加的資源,復制自動生成的ID 3. 在解決方案資源管理器中找到Resource.h檔案,編輯,使用整個專案搜索和替換的方式快速替換 宏宣告 4. Ctrl+Shift+F 全域搜索,點擊查找全部,然后逐個替換 5. 為什么使用搜索替換而不使用屬性視窗直 ......

    uj5u.com 2020-09-10 00:59:11 more
  • 【C++犯錯記錄】VS2019 MFC不懂的批量添加資源

    1. 打開資源頭檔案Resource.h,在其中預先定義好宏 ID(不清楚其實ID值應該設定多少,可以先新建一個相同的資源項,再在這個資源的ID值的基礎上遞增即可) 2. 在資源視圖中選中專案資源,按F7編輯資源檔案,按 ID 型別 相對路徑的形式添加 資源。(別忘了先把檔案拷貝到專案中的res檔案 ......

    uj5u.com 2020-09-10 01:00:19 more
  • C/C++編程筆記:關于C++的參考型別,專供新手入門使用

    今天要講的是C++中我最喜歡的一個用法——參考,也叫別名。 參考就是給一個變數名取一個變數名,方便我們間接地使用這個變數。我們可以給一個變數創建N個參考,這N + 1個變數共享了同一塊記憶體區域。(參考型別的變數會占用記憶體空間,占用的記憶體空間的大小和指標型別的大小是相同的。雖然參考是一個物件的別名,但 ......

    uj5u.com 2020-09-10 01:00:22 more
  • 【C/C++編程筆記】從頭開始學習C ++:初學者完整指南

    眾所周知,C ++的學習曲線陡峭,但是花時間學習這種語言將為您的職業帶來奇跡,并使您與其他開發人員區分開。您會更輕松地學習新語言,形成真正的解決問題的技能,并在編程的基礎上打下堅實的基礎。 C ++將幫助您養成良好的編程習慣(即清晰一致的編碼風格,在撰寫代碼時注釋代碼,并限制類內部的可見性),并且由 ......

    uj5u.com 2020-09-10 01:00:41 more
最新发布
  • Rust中的智能指標:Box<T> Rc<T> Arc<T> Cell<T> RefCell<T> Weak

    Rust中的智能指標是什么 智能指標(smart pointers)是一類資料結構,是擁有資料所有權和額外功能的指標。是指標的進一步發展 指標(pointer)是一個包含記憶體地址的變數的通用概念。這個地址參考,或 ” 指向”(points at)一些其 他資料 。參考以 & 符號為標志并借用了他們所 ......

    uj5u.com 2023-04-20 07:24:10 more
  • Java的值傳遞和參考傳遞

    值傳遞不會改變本身,參考傳遞(如果傳遞的值需要實體化到堆里)如果發生修改了會改變本身。 1.基本資料型別都是值傳遞 package com.example.basic; public class Test { public static void main(String[] args) { int ......

    uj5u.com 2023-04-20 07:24:04 more
  • [2]SpinalHDL教程——Scala簡單入門

    第一個 Scala 程式 shell里面輸入 $ scala scala> 1 + 1 res0: Int = 2 scala> println("Hello World!") Hello World! 檔案形式 object HelloWorld { /* 這是我的第一個 Scala 程式 * 以 ......

    uj5u.com 2023-04-20 07:23:58 more
  • 理解函式指標和回呼函式

    理解 函式指標 指向函式的指標。比如: 理解函式指標的偽代碼 void (*p)(int type, char *data); // 定義一個函式指標p void func(int type, char *data); // 宣告一個函式func p = func; // 將指標p指向函式func ......

    uj5u.com 2023-04-20 07:23:52 more
  • Django筆記二十五之資料庫函式之日期函式

    本文首發于公眾號:Hunter后端 原文鏈接:Django筆記二十五之資料庫函式之日期函式 日期函式主要介紹兩個大類,Extract() 和 Trunc() Extract() 函式作用是提取日期,比如我們可以提取一個日期欄位的年份,月份,日等資料 Trunc() 的作用則是截取,比如 2022-0 ......

    uj5u.com 2023-04-20 07:23:45 more
  • 一天吃透JVM面試八股文

    什么是JVM? JVM,全稱Java Virtual Machine(Java虛擬機),是通過在實際的計算機上仿真模擬各種計算機功能來實作的。由一套位元組碼指令集、一組暫存器、一個堆疊、一個垃圾回收堆和一個存盤方法域等組成。JVM屏蔽了與作業系統平臺相關的資訊,使得Java程式只需要生成在Java虛擬機 ......

    uj5u.com 2023-04-20 07:23:31 more
  • 使用Java接入小程式訂閱訊息!

    更新完微信服務號的模板訊息之后,我又趕緊把微信小程式的訂閱訊息給實作了!之前我一直以為微信小程式也是要企業才能申請,沒想到小程式個人就能申請。 訊息推送平臺🔥推送下發【郵件】【短信】【微信服務號】【微信小程式】【企業微信】【釘釘】等訊息型別。 https://gitee.com/zhongfuch ......

    uj5u.com 2023-04-20 07:22:59 more
  • java -- 緩沖流、轉換流、序列化流

    緩沖流 緩沖流, 也叫高效流, 按照資料型別分類: 位元組緩沖流:BufferedInputStream,BufferedOutputStream 字符緩沖流:BufferedReader,BufferedWriter 緩沖流的基本原理,是在創建流物件時,會創建一個內置的默認大小的緩沖區陣列,通過緩沖 ......

    uj5u.com 2023-04-20 07:22:49 more
  • Java-SpringBoot-Range請求頭設定實作視頻分段傳輸

    老實說,人太懶了,現在基本都不喜歡寫筆記了,但是網上有關Range請求頭的文章都太水了 下面是抄的一段StackOverflow的代碼...自己大修改過的,寫的注釋挺全的,應該直接看得懂,就不解釋了 寫的不好...只是希望能給視頻網站開發的新手一點點幫助吧. 業務場景:視頻分段傳輸、視頻多段傳輸(理 ......

    uj5u.com 2023-04-20 07:22:42 more
  • Windows 10開發教程_編程入門自學教程_菜鳥教程-免費教程分享

    教程簡介 Windows 10開發入門教程 - 從簡單的步驟了解Windows 10開發,從基本到高級概念,包括簡介,UWP,第一個應用程式,商店,XAML控制元件,資料系結,XAML性能,自適應設計,自適應UI,自適應代碼,檔案管理,SQLite資料庫,應用程式到應用程式通信,應用程式本地化,應用程式 ......

    uj5u.com 2023-04-20 07:22:35 more