An example analysis of MVC pattern in Java Web application

Source: Internet
Author: User

Combine six basic mass properties:

    • Ease of use: users do not conform to the rules of the input will have a corresponding prompt
    • Security: User authentication through user name, password, MD5 encryption of user's password
    • Availability: Exception
    • Modifiable: Enables connection to different databases by modifying the Dbutil class

The MVC design implementation of the login function module:

    • View: Login interface (login.jsp); Login successful Interface (MAIN.JSP)

    • Controller:web.xml; Adminservlet.java

    

    • Model:adminbean; Admindao

    • Flowchart of Implementation:

     

From what we can see, first login.jsp a servlet request, filtered through the Web. Xml. Jump to Adminservlet.java. In Adminservlet, it sends a request to Admindao to check whether the logged-on user is legitimate (that is, to call the Checklogin function in Admindao), and then Admindao to query through the database whether the user or password is consistent. Then call Adminbean to encapsulate it into a data entity returned to Adminservlet,servlet to redirect to that view based on the returned result.

An example analysis of MVC pattern in Java Web application

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.