JBuilder2005 Practical JSP Program function introduction

Source: Internet
Author: User
Tags exit error handling table name
The structure of the js| program User Login module program is shown in the following illustration:


Figure 1 Example page flow diagram
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.

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

JSP page Description login.jsp login JSP page switch.jsp password verification and Page flow control JSP page. error.jsp error handling JSP pages, in a friendly manner to the customer to report the program error. The error-handling page for all other JSP pages. Welcome.jsp the Welcome page after successful login. We have referenced a set of Third-party tag libraries on this page. FAIL.JSP Login failed to turn to this error-handling page. Quit.jsp the page that is called after exiting the system, which is responsible for clearing the session and ending it.
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 the users object and is responsible for writing logins and exiting logs. UserList gets all the 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 records 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.