How does Struts2 implement MVC, and what is the difference from spring MVC?

Source: Internet
Author: User

  STRUTS2 uses filter as the front-end controller to process the request, and filter distributes the request to different business controller actions based on the Struts.xml configuration, and the action processes the specific business logic. After the action has finished processing the business, filter will find the corresponding result from the Struts.xml based on the string it returns, and eventually the request is forwarded to the page by result.

The idea of this implementation is basically consistent with spring MVC. The differences are as follows:

(1) Spring uses a servlet to act as a front-end controller to distribute requests.

(2) Spring uses requestmapping to configure the relationship between the request and the business controller.

(3) Spring uses a controller to act as a business controller.

(4) Spring uses Viewresolver to forward requests to the page.

How does Struts2 implement MVC, and what is the difference from spring MVC?

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.