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