Data run process for MVC development model

Source: Internet
Author: User

For Java in the classic development model MVC, there are some feelings! Now say Java data in the running process, due to my limited technology, the wrong words welcome, do not like to spray!

We know that in the MVC development model, which includes three parts of the View Layer V (view), control layer C (Controller), and model layer m, what do these three parts refer to in a project?

The view layer: By definition refers to the interface you see, usually what we call a JSP page.

Control layer: Refers to a servlet.

Model layer: Except for these two parts, all that remains.

Here I'm going to show you the way the data flows in the form of a drawing.

1. When we click on an event on the JSP page, the submission method via post or get is based on the configured action

2. When the corresponding servlet receives a request submitted by a JSP page, it also gets the elements of the page based on the page element name. The interface will be called in this servlet

3. When the servlet invokes an interface, the interface queries its implementation class

4. A tool class that inherits JDBC in the implementation class and connects to the database by means of a method

5. When connecting to a database, inject values into SQL statements by hard compilation or precompilation

6.7 When a database queries out data, the query result set is implemented in a class by JDBC, encapsulated as an object or a collection in the implementation class

8.9 This result is now returned to the servlet with the interface that was originally called by the servlet

10. In Servle, the result of the query is processed by the logical call T, and the final processed data is forwarded to the JSP page by redirection or request.

Finally, the final page is completed in the foreground with El tags and JavaScript.

Data run process for MVC development model

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.