Example: Using a user login verification instance to explain the MVC design pattern
Login program has been learned before, is the use of JSP+JDBC completed development operations, but the previous logon process can be found in the development of a lot of problems, is a JSP file in the code too much, even if the use of the Jsp+javabean development model, its own JSP in the code too many problems.
Now we can use the MVC design pattern to completely solve the problem of too much code.
In this program, the login information entered by the user is submitted to the servlet for receiving, and the servlet verifies its legality first after receiving the request (if the input is empty or if the length satisfies the requirement, etc.), and if the validation fails, the error message is passed to the login page, and if the data is valid, The DAO layer is called to complete the validation of the database, and the validated structure jumps to the page where the login succeeds or the login fails.
Need to develop the page olives as follows: