JSP Model1 mode making easy where to go the net Recruit Interface (four)

Source: Internet
Author: User

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)

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.