Spring-mvc Journey (i)--Introduction to core classes and interfaces

Source: Internet
Author: User

1.SPRING-MVC is the MVC framework for Web development, and the spring2.5 version begins to support annotation configurations, making usability much more accessible.

2.spring contains the core classes and interfaces

1). The Dispatcherservlet Class (front controller) is mainly used for responsibility scheduling and is itself responsible for process control:

File upload parsing, if the request type is multipart will be through the Multipartresolver file upload parsing;

    Map the request to the processor via handlermapping (returns a Handlerexecutionchain, which includes a processor, multiple handlerinterceptor interceptors);

Support for multiple types of processors (processors in handlerexecutionchain) via Handleradapter;

Through the Viewresolver parse the logical view name to the concrete view realization;

    localization analysis;

Render a specific view, etc.;

If an exception is encountered during execution, it will be given to handlerexceptionresolver for parsing.

2). Handlermapping interface = = map for processing requests

Its implementation class:

simpleurlhandlermapping mapping a URL to a controller through a configuration file

defaultannotationhandlermapping maps a URL to a controller class via annotations

3). Handleradapter interface = = map for processing requests

Its implementation class:

The Annotationmethodhandleradapter class, through annotations, maps a URL to the method of the Controller class

4). Controller Interface = = Controllers

Classes that use @controller annotations can assume the responsibility of the Controller (Action) and do not need to use this interface.

5). Viewresolver interface = = Defines the Resolverviewname method to create the appropriate type of view implementation based on ViewName

Its implementation class:

The Urlbasedviewresolver class passes a configuration file and gives a view name to the

Internalresourceviewresolver class, than the above class, joined the JSTL support

6). Handlerexceptionresolver interface = = Exception handling

The 3.SPRING-MVC core flowchart is as follows:

Spring-mvc Journey (i)--Introduction to core classes and interfaces

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.