This article was adapted from: Lebyte

This article mainly explains: SpringMVC implementation process

For more Java related knowledge, you can follow the public account “LeByte” to send: 999

SpringMVC, this should be the domestic interview question, there are many answers on the Internet, in fact, back to back. But today I take you out of the source code, look at his principle. In order to make a deeper impression, the interview time.

Here’s a picture:

Code location: com. Interface21. Web. Servlet. DispatcherServlet# doService

(Yes, the code for Spring 1.0 is very simple. Now Spring is too bloated after 15 years of development. Interface 21 is the best code from a learning point of view.)

The code is as follows:

What exactly does this adapter do? The HandlerAdapter comment reads: This interface is not intended for application developers. It is available to handlers who want to develop their own web workflow. This interface is not intended for application developers. It is suitable for processors that want to develop their own Web workflow.

Just to say, if you want to do something before you process the handler, you might want to do this, which is adapt the handler. For example, the Spring test program does this:

There’s nothing to talk about, is there?

Thank you for your recognition and support, xiaobian will continue to forward “LeByte” quality articles