Be familiar with Model1 mode according to the content of Hanshunping Teacher's explanation.
The Model1 pattern consists of a number of mutually independent JSP files and Java beans (not required), which are then obtained from the HttpRequest with the required data, processed in the appropriate business logic, and then returned to the front-end browser via response.
The Model1 development process is divided into two categories:
1, Model1 (pure JSP technology, without any Java beans)
2. Model1 (Jsp+java Bean)
Disadvantages of the MODEL1 model:
1, the performance layer and business logic layer mixed together---chaos!!!
2, in the development process, not conducive to multi-person co-development.
3, not conducive to post-maintenance.
Advantages of the MODEL1 mode:
1, simple, development speed is relatively fast;
2, relatively suitable for the development of small projects.
We use the pure JSP technology in MODEL1 mode to develop a simple user login system (temporarily without database).
Mainly for learning:
1, familiar with the JSP page jump;(below two studies later)
2, JSP How to operate the database;
3. How to display data/How to page out JSP
It mainly involves three pages:
login.jsp
verify.jsp
welcome.jsp
Business logic:
login.jsp for the landing page, the user needs to enter the user name and password, enter the verify.jsp to verify the operation:
If the user name entered is Dahuang and the password is 123, the successful jump to the welcome.jsp page, otherwise , then return to login.jsp.
The login.jsp page code is as follows:
<%@ page language= "java" contenttype= "text/html; CHARSET=GBK "pageencoding=" GBK "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
The verify.jsp code is as follows:<%@ page language= "java" contenttype= "text/html; CHARSET=GBK "pageencoding=" UTF-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
The welcome.jsp code is as follows:<%@ page language= "java" contenttype= "text/html; CHARSET=GBK "pageencoding=" UTF-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
Display effect:The login interface is as follows:
The login success interface is as follows:
JSP Model1 mode making easy where to go the net Recruit Interface (four)