JBuilder2005 Practical JSP Program function introduction

Source: Internet
Author: User
Tags exit error handling table name

The structure of the user login module program is shown in Figure 1:

Users enter the password in the login page, verify the correct turn to the Welcome home page, if the password entered incorrectly, the login failed page. This module contains 6 JSP files, 3 Java classes, and two background tables.


Figure 1 Example page flow diagram

6 JSP files for user login, page flow control, error handling, login success and failure, as well as the Exit System processing page, briefly described as follows:

Table 1 JSP files

description
login jsp page
switch.jsp password verification and page flow control JSP pages.
error.jsp error handling JSP page To report the program's errors in a friendly way to the customer. The error-handling page for all other JSP pages.
welcome.jsp login succeeded to the Welcome page. We have referenced a set of Third-party tag libraries on this page.
fail.jsp > Login failed, turn to this. Error-handling page.
quit.jsp

JSP files are mainly responsible for the presentation of the page, and business logic or resource processing functions can be placed in the Java class, the form data can be encapsulated by the bean, the module provides 3 classes, described below:

Table 2 3 Java classes

Class Description
DbConnection Gets the connection to the database.
User Describes user objects and is responsible for writing logins, exiting logs.
UserList Gets all users of the system and converts to a Web page drop-down box.

User information and user login information with a database table to store, select Oracle 9i as our database, of course, you can also use other types of databases, as long as the corresponding adjustment dbconnection class and table SQL definition statements can be, the cost of this transplant is very small, The purpose and structure of the two tables are described below:

Table 3 2 Database tables

Table name Description
T_user User Information table containing 3 fields of user ID, username, and password.
T_login_log Record the time of user login and the time of exit, the log primary key is generated by using a sequence seq_login_log_id.

The two database tables and sequences are structured as follows:


Fig. 2 data table and sequence
The database username/password is: JBUSER/ABC. Before embarking on the development of our login module, you must first create a user in the database, create a build table, and a sequence.
Related Article

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.