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