Worthy of being an Alibaba, he even stayed up late to write a "Spring MVC Source Notes" and compiled it into a document, hurry up and collect it!

Preface

Today, I will share with you a freshly baked "Spring MVC Source Notes" from Ali P7 big cow who stayed up late.

Let's introduce the general content of "Spring MVC Source Notes"!

One, know SpringMVC

1. What is SpringMVC?

SpringMVC is a member of the Spring family. Spring is a framework that combines popular components currently in development! It is used in the development of the presentation layer based on MVC, similar to the struts2 framework

 

2. Why use SpringMVC?

We have learned Struts2 before, such a framework based on MVC... Then we have learned Struts2, why should we learn SpringMVC? ? ?

 

3. Review Struts2 development

If you haven't touched Struts2, you can skip it here. Struts2 can not learn

 

4. Struts2 workflow

 

5. SpringMVC quick start

 

6, SpringMVC workflow

 

7、AbstractCommandController

 

8. Small summary

 

Two, parameter binding, data echo, file upload

The main knowledge points explained here are as follows:

  • Parameter binding

  • Data echo

  • File Upload

1. Parameter binding

We use the method parameter to receive the value in the Controller, which is to receive the value of the web side into the Controller for processing. This process is called parameter binding

 

2. Data echo

In fact, data echo is not unfamiliar to us now....We have already learned data echo when we first used EL expressions, and when we were doing SSH projects, there were also three-round data echoes.

 

3. SpringMVC file upload

When we used Struts2, we felt that the file upload method of Struts2 was much better than the traditional file upload method...

Now that we are learning SpringMVC, let's take a look at how SpringMVC uploads files...

 

4. Summary

Forward + follow, and reply to "T4" by private message to get a free way to receive the freshly released "Spring MVC Source Notes"!

 

 

Three, interceptor, unified exception handling, RESTful, interception

The main knowledge points explained here are as follows:

  • Verifier

  • Unified exception handling

  • RESTful

  • Interceptor

1、Validation

 

2. Unified exception handling

 

3. RESTful support

 

4. SpringMVC interceptor

In Struts2, the interceptor was our core at the time. It turned out that there was also an interceptor in SpringMVC.

 

5. Summary

 

 

SpringMVC is very easy to use when we use it. It actually helps us to do a lot internally (there are various HandlerAdaptors). SpringMVC still faces a lot of request process interviews. You can still look at the source code for what it helped us do. After going through it, you may find that you can understand the previous configuration.

 

Guess you like

Origin blog.csdn.net/JavaBUGa/article/details/108637753