Absrtact: Original Creation Place: www.bysocket.com Mason bysocket Hope reprint, keep abstract, thank you!
Simple is good, life can be very German
Q: What is Spring MVC? ※
Spring MVC is an important module of the spring Web. Spring supports WEB applications, and spring MVC is support for the MVC pattern.
Q:MVC mode? ※
The MVC pattern is a classic software architecture, divided into model models, view views, and controller controllers in three roles. The intent of the architecture clearly distinguishes between the responsibilities of the three roles and makes them non-interdependent. Java is the most classic implementation of JSP + Servlet + JavaBean, followed by a number of outstanding frameworks, SSH Struts, as well as SSM in the Spring MVC.
q:spring What other modules do I need? Web? IOC container? Aop? ※
Both the IOC container module and the AOP module are. There are also data access/integration, WEB and other modules are. Others here do not unfold, where the Web module is built on top of the IOC container to remember.
Module diagram from the official website:
Does the Q:web module contain SPRINGMVC? ※
Contains. The Web module contains Spring-web, SPRING-WEBMVC, Spring-websocket, and Spring-webmvc-portlet. One of the WEB-MVC is that we want to learn the source package.
1. The Spring-web module provides basic Web integration functionality, including initialization of IOC containers.
2. SPRING-WEBMVC contains the implementation of the MVC pattern and the implementation of the REST Web service. The module is based on the Spring-web module.
The information comes from: Official document MVC chapter, other modules specific reference website.
What exactly does the Q:spring-webmvc module contain? ※
SPRING-WEBMVC module in the bread:
The
- org.springframework.web.servlet
provides a servlet that integrates with the application context infrastructure, as well as the core interfaces and classes of the Spring Web MVC framework. The
- Org.springframework.web.servlet.mvc
Spring comes with the standard controller implementation of the servlet MVC framework.
The
- org.springframework.web.servlet.mvc.annotation
Support package for the annotation-based servlet MVC controller. The
- org.springframework.web.servlet.mvc.condition
is used to match the public MVC logic of the incoming request based on the criteria. The
- Org.springframework.web.servlet.mvc.method
is a servlet-based infrastructure for handling program methods, based on the Org.springframework.web.method on the package. The
- org.springframework.web.servlet.view
provides standard view and Viewresolver implementations, including the abstract base class for custom implementations.
The
- Org.springframework.web.servlet.view.freemarker
supports classes that make Freemarker collections a Spring Web view technology. The
- Org.springframework.web.servlet.view.json
supports classes that provide a view implementation based on JSON serialization.
The core package is listed above. In the Org.springframework.web.servlet.view package, view view implementations are common: JSON, Freemarker, and so on. In ORG.SPRINGFRAMEWORK.WEB.SERVLET.MVC package, controller control layer implementation includes annotations, program method processing and other encapsulation. Naturally, look at the source code first from the Org.springframework.web.servlet package to see its core interface and class.
Q: What are the core classes and interfaces? ※
Dispatcherservlet class: Dispatches the HTTP request controller (or processor handler).
View Layer
Modelandview class: The owner of the model and view.
View interface: MVC WEB interaction. The implementation of this interface is responsible for rendering the view or exposing the model.
Controller control Layer
Handlermapping interface: Request comes from Dispacherservlet, which defines the mapping between the request and the handler object.
Handlerinterceptor interface: The execution chain interface of the handler.
Q: What is MVC like again? ※
Oh. And here's a picture:
So the important classes are viewresolver, Handleadapter and so on.
Q: Thank you, what's the next conversation?
Of course, talk about the important types of source implementation of the next article see.
If the above article or link is helpful to you, don't forget to comment at the end of the article AH ~ You can also click on the right side of the page "share" hover button oh, let more people read this article.
Learn Spring MVC source with problems: I. Overview