JSP+SERVLET+MVC mode diagram

Source: Internet
Author: User

in our development, the most commonly used development mode is the MVC pattern, namely M--model, V--view, C--controller, so that not only can facilitate the development of the Division of Labor collaboration, improve the development efficiency, enhance the maintainability of the program and expand, And the controller separates the model from the view, reducing the coupling between them. The following diagram illustrates the application of MVC in Servlets and JSPs.


Looking at this picture, we can probably see the MVC in the servlet+jsp development of the specific embodiment of the various modules, perhaps the above painting or can not be specifically described in the MVC they represent the specific meaning and role, let us specify:

① Model: The model holds all the data, state and program logic, the model is independent of the attempt and the controller, and the model is mainly embodied in the data carrier JavaBean and the program logic Service layer and the DAO layer that produce the data.

② view: Used to render the model. The view usually takes the state field data that it needs to display directly from the model. For the same information can be multiple different display forms or attempts, the main embodiment of the view on the JSP.

③ controller: In the middle of the attempt and the model, is responsible for accepting the user input, parsing the input and feedback to the model, usually a view has a controller, the main embodiment in the servlet.

So far, the embodiment of MVC in servlet+jsp and the description of the MVC pattern has been completed, there are insufficient places, I hope you have a lot of advice!

JSP+SERVLET+MVC mode diagram

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.