Examples of web development patterns: mvc--to standard development

Source: Internet
Author: User

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:

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.