SpringMVC source code: Initialization of DispatcherServlet (3)

In the previous part, FrameworkServlet left onRefresh to DispatcherServlet to complete, So go into DispatcherServlet # onRefresh Refresh the Spring container (the sub-container is refreshed here) @Override protected void onRefresh(ApplicationContext context) {<!– –> initStrategies(context); //The parameter context here is the SpringWeb container created before (and later passed as a parameter to the initialization function of […]

[Spring MVC Research] Register 9 special components in Spring MVC to the DispatcherServlet attribute.

Article directory 0. Brief description of the working principle of Spring MVC 1. 9 special components in Spring MVC 2. Registration principles of 9 components 3. Questions about Spring MVC registration components 3. Reference Background: Spring MVC is an MVC framework and an implementation of the Servlet specification. The Servlet specification defines many components, which […]

interface21 – web – DispatcherServlet (DispatcherServlet initialization process)

Foreword Recently I plan to take some time to take a good look at the source code of Spring. However, there are too many iterated versions of Spring’s source code. It is relatively large and looks tiring, so I plan to start with the initial version (interface21), just for learning. Understand its design philosophy, and […]

Spring MVC 5 – DispatcherServlet initialization process (continued)

Today’s content is the initialization process of SpringMVC, which is actually the initialization process of DispatcherServilet. Special Bean Types DispatcherServlet delegates the following special beans to handle requests and render correct returns. These special beans are beans managed by the Spring MVC framework and handle related requests according to the conventions of the Spring framework. […]

Spring MVC 5 – Spring MVC configuration and DispatcherServlet initialization process

Today’s content is the initialization process of SpringMVC, which is actually the initialization process of DispatcherServilet. Special Bean Types DispatcherServlet delegates the following special beans to handle requests and render correct returns. These special beans are beans managed by the Spring MVC framework and handle related requests according to the conventions of the Spring framework. […]

A brief introduction to Kotlin coroutines and context and dispatchers (Dispatchers)

Coroutine Overview Subprograms, or functions, are hierarchical calls in all languages. For example: A calls B, B calls C during execution, C returns after execution, B returns after execution, and finally A completes execution. So subroutines are implemented through the stack, and a thread executes a subroutine. Subroutine calls always have one entrance and one […]

javax.servlet.ServletException: Servlet.init() of Servlet[dispatcher] threw an exception —- solution

Directory javax.servlet.ServletException: Servlet.init() of Servlet[dispatcher] threw an exception —- solution Question: Report 500 error: Solution operation result javax.servlet.ServletException: Servlet.init() of Servlet[dispatcher] throws an exception—-solution Problem: Report 500 error: Type Exception Report Servlet.init() of message Servlet[dispatcher] threw an exception Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exceptions javax.servlet.ServletException: Servlet.init() […]

javax.servlet.ServletException: Could not resolve view with name in servlet with name ‘dispatcherSer

Error reporting: The view cannot be parsed, and the conversion of java objects to json data is unsuccessful? Exception reason: Controller layer annotation error Error details: javax.servlet.ServletException: Could not resolve view with name ‘xxxx/xxxx’ in servlet with name ‘dispatcherServlet’ at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1351) ~[spring-webmvc-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1117) ~[spring-webmvc-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1056) ~[spring-webmvc-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.9.RELEASE.jar:5.1.9.RELEASE] at […]

SpringMVC source code-DispatcherServlet

1. SpringMVC request processing flow DispatcherServlet: DispatcherServlet is the front controller in SpringMVC, which is responsible for receiving the request and forwarding the request to the corresponding processing component. HandlerMapping: HanlerMapping is a component in SpringMVC that completes the mapping from url to Controller. Handler: The Handler processor is actually our Controller. It has many […]