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?