JSP+access mobile phone sales system (thesis + system + opening topic + cover + title page + demand analysis + task book)

Software Course Design Report

hand

machine

exist

Wire

pin

sell

system

system

Major : Computer Science and Technology Major Classes :

team member:

Instructor: Title:

middle

20  's

topic Mobile phone online sales system
design date 20 to 20
team member The tasks undertaken in this design document grade
Serve as the team leader, and mainly design the mobile phone sales forum in the design.
Responsible for the design of the front desk program of the mobile phone sales forum and the forum search part.
Serve as the background management program of the mobile phone sales forum.
Act as the realization of the user function of the mobile phone sales forum.
Instructor's signature: Year Month Day

item

eye

open

hair

total

Knot

report

tell

Project Development Summary Report

【Abstract】 Through the construction of online shopping system to realize the information management of commercial retail enterprises. Established a B2C network sales system. The system function and realization, data flow and storage are discussed emphatically, including commodity catalogue, user registration, online ordering and shopping, stock query, background database management and so on.

Use key technologies such as HTML language, JavaScript technology, JSP and background database link to build an online shopping system. Realize the following functions of the online shopping system:

(1) Provide customers with 24-hour convenient and fast online ordering service.

(2) Maintenance and management of commodity information.

(3) Efficient commodity data scheme, scientifically and flexibly classify and store commodity information.

(4) Powerful, convenient and fast query.

(5) Order number module.

(6) Integrate customer business logic rules into the system, that is, provide different payment methods according to different customer attributes.

(7) Order management.

【Key words】 B2C, online shopping system, JSP, database

I. Introduction

  1. purpose of writing

The following is a further analysis of the current status of online shopping based on the China B2C E-commerce Development Report released by CNNIC (China Internet Network Information Center). (Mainly refer to the analysis chart in it)

Due to the above advantages, e-commerce is developing very rapidly in our country, and it has become a very popular field, which is why we choose the online shopping system for this course design! Not only can you learn how to make websites, but you can also deepen your understanding of the most popular fields and accumulate experience for future study or work!

1.2 Background

As the front-end business platform of B2B, B2C (Business to Customer, business-to-consumer), C2C (Customer to Customer, consumer-to-consumer) e-commerce, the online ordering system plays a pivotal role in the whole process of its business activities. effect. Online shopping is a business information system with interactive functions. It provides users with static and dynamic information resources. The so-called static information refers to those resources that are more frequently changed or updated, such as company profiles, management norms, and company systems, etc.; dynamic information refers to information that changes at any time, such as commodity quotations, meeting arrangements, and training information. The online shopping system has a powerful interactive function, which enables merchants and users to transfer information conveniently and complete electronic trade or EDI transactions. This new transaction method realizes the paperless exchange of documents and funds between companies.

In the United States, Japan and other countries and regions with a high degree of informatization, online stores are developing rapidly, and world-class and super-class retailers in the United States, such as Wal-Mart, Kmart, Home Storage, Kroger, JC Penny, etc. are crowded In the ranks of network business. The survey shows that American families have become more and more accustomed to shopping online at home.

In our country, online shopping has grown from scratch in just a few years. my country's first online shopping took place in 1996. Lufthansa Friendship Shopping Center sold a cloisonne through an online store for the first time. Although the payment for the goods was not done online, it was the first online shopping for my country's retail industry. According to the statistical results of CNNIC, as of January 2004, there were 79.5 million Internet users in China, and more than 40.7% of Internet users had online shopping experience in the past year, which shows that there are 79.5 million Internet users in China. 32.357 million, and this number is still growing at a rate of about 17%. It is estimated that by 2006, China's online shopping users will reach 69.62 million, which shows that the development of online shopping in China has a good mass base, and online shopping is increasingly popular Accepted by everyone.

The characteristics of e-commerce include the following points: commerce, integration, scalability, service, security, and coordination.   

one. Commerciality The most basic feature of   
  e-commerce is commerciality, that is, to provide services, means and opportunities for buying and selling transactions. Online Shopping

Provide a convenient way for customers to demand. Thus, e-commerce is an opportunity for businesses of any size.

It is no exception for our traditional enterprises in China.

two. Integration   
 a. Technology integration

Since the entire process of e-commerce involves a lot of content, such as information, finance, services, etc., in order to make the whole process run normally, it is necessary to use technology to realize it. Of course, the more advanced the technology, the better, such as from html From asp to jsp to the current jsp.net, this is a process of technological development, and it is also the need for practical application.

b. Information integration

Everyone on the Internet is searching for information that is useful to them, so it should provide a lot of information to meet the needs of different users. Now there are more and more commercial websites facing customers in China. Speed, to search for the most useful information, should probably be the most important consideration for this type of website.

three. Scalability

This is mainly for the stability of the system. The service system of e-commerce should have its own extension function. Because the system should be able to withstand a certain load, if the server crashes during a certain peak access period, the result can be imagined.

Four. Service   
  In the e-commerce environment, customers are no longer subject to geographical restrictions. Using the Internet as the medium of this kind of trade, his partners can be any other corner of the earth. If you want people all over the world to accept all your services The quality of goods and services provided is the most critical. Technological innovation has brought new results, and the application of the World Wide Web enables enterprises to automatically handle business processes, and no longer emphasizes the division of labor within the company as it used to. Now many enterprises can provide customers with complete services on the Internet, which enables the application of the Internet to be fully utilized.

five. safety

In e-commerce, security is the core issue that must be considered. Deception, eavesdropping, viruses and illegal intrusions are all threatening e-commerce, so it is required that the network can provide an end-to-end security solution, including encryption mechanism, signature mechanism, distributed security management, access control, firewall, secure World Wide Web server , antivirus protection, etc. With the development of technology, the security of e-commerce will be enhanced accordingly.  

six. coordination

Business activity is a coordination process that requires coordination between employees and customers, producers, suppliers, and business partners. In order to improve efficiency, many organizations have provided interactive agreements, and e-commerce activities can be carried out on the basis of these agreements.

1.3 Definition

HTML language:

HTML (Hyper Text Markup Language) is a simple markup language used to make hypertext documents. Unlike common word processing documents, web pages are formatted in hypertext markup language. HTML files are standard text files with specific HTML insertion tags for document properties and formatting. It can be independent of various operating system platforms (such as UNIX, WINDOWS, etc.). Since 1990, HTML has been used as an information representation language on the World Wide Web to describe the format design of a Homepage and its link information with other Homepages on the WWW.

JavaScript technology:

JavaScript is an object-based (Object) and event-driven (Event Driven) scripting language with security performance. The purpose of using it is to realize linking multiple objects in a Web page together with HTML hypertext markup language and Java scripting language (Java applet), and to interact with Web clients. This enables the development of client-side applications and the like. It is implemented in the standard HTML language by embedding or calling in. Its appearance makes up for the defects of the HTML language, and it is a compromise between Java and HTML

JSP:

JSP (Java Server Pages) is a dynamic web technology standard initiated by Sun Microsystems and established by many companies. JSP technology uses the JAVA language as the scripting language, and the JSP web page provides an interface for the entire server-side JAVA library unit to serve HTTP applications.

Database principle:

① Brief introduction of SOL language

SQL is the abbreviation of English Structured Query Language, which means Structured Query Language.

  The main function of the SQL language is to establish connections and communicate with various databases. According to ANSI (American National Standards Institute), SQL is used as a standard language for relational database management systems. SQL statements can be used to perform various operations such as updating data in a database, extracting data from a database, etc.

② JDBC, ODBC technology introduction

JDBC
----JDBC (Java DataBase Connectivity) is an interface specification between Java and databases. JDBC defines a general low-level application programming interface (API) that supports standard SQL functions. It consists of classes and interfaces written in Java language. It is designed to allow database developers to provide standard database APIs for Java programmers. The JDBC API defines several classes in Java, representing database connections, SQL commands, result sets, database metadata, and more. It allows Java programmers to send SQL commands and process the results. Through the driver manager, JDBC API can use different drivers to connect to different database systems. .

ODBC
---- ODBC (Open DataBase Connectivity) is an application programming interface (API) advocated by Microsoft and widely accepted by the industry for database access. It uses X/Open and ISO/IEC call-level interface ( CLI) specification and uses Structured Query Language (SQL) as its database access language. The overall structure of ODBC has four components:
---- The application performs processing and calls ODBC API functions to submit SQL statements and retrieve results.

---- Driver Manager (Driver Manager) According to the application needs to load / unload the driver, handle ODBC function calls, or send them to the driver.

---- The driver processes ODBC function calls, submits SQL requests to a specified data source, and returns the results to the application. If necessary, the driver modifies an application request to conform to the syntax supported by the associated DBMS.

---- The data source includes the data that the user wants to visit and its related operating system, DBMS and network platform for accessing the DBMS.

③ Access database

Access is a database management system. The reason why it is integrated into Office instead of Visual Studio is that it is easier to learn than other database management systems (such as Visual FoxPro), and an ordinary computer user can master it and learn it. use it. And the most important point is that the function of Access is powerful enough to meet the needs of general data management and processing.

1.4 References

Book information:

"JSP Practical Programming Examples Collection" Tsinghua University Press Ma Wengang et al.

"Java Case Development" edited by Zhang Liang, China Water Conservancy and Hydropower Publishing House, etc.

"Design and Realization of E-Commerce Website" Journal of Huaqiao University Yan Guilan, Liu Jiayao

Reference and Professional Websites

http://www.cnjsp.org

http://mobile.163.com/

2 Actual development results

2.1 Products

The mobile phone sales system is roughly divided into four parts: the front desk, the background, the shopping cart and the forum.

Foreground JSP pages include: index., view, paihang, top, basket, userts...etc. The homepage of the website is index

The background Access database includes 19 tables: ad, admin, basket, company, dlpf, guest, hw, logo, member,

Modify, news, newsclass, nsort, ps, pub, sort, sub, system, ts tables.

2.2 Main functions and performance

(1) Provide customers with 24-hour convenient and fast online ordering service.

(2) Maintenance and management of product information, including price adjustment, modification of existing product information, addition of new product information, deletion of outdated product information, etc.

(3) Efficient commodity data scheme, scientifically and flexibly classifying and storing commodity information, so that customers can quickly find the commodities they need from as few as tens of thousands, as many as hundreds of thousands or even millions of commodities.

(4) Powerful, convenient and fast query function. Provide keyword query (such as: find all "NOKIA" products).

(5) Order number module The so-called order number module means that after the customer purchases the product, the system automatically assigns a shopping number to the customer, so that the customer can check the bill processing status at any time. Know the current status of the goods.

(6) Integrate customer business logic rules into the system, that is, provide different payment methods according to different customer attributes. (such as credit card, check, etc.)

(7) Order management. Provide data interface for distributor's EPR system. Administrators can view history, order status, and be able to notify users in the shortest possible time.

(8) Customer Forum. Customers can share their experience, report problems online, and get the latest news!

The system has fulfilled the functional requirements formulated in advance, and added the functions of the forum. The functions are well used without any major problems.

2.3 Basic process

System front-end process flow diagram

System background flow diagram

2.4 progress

The completion time of the system is 2005-6-28, and the expected completion time is 2005-6-29, which is basically completed on time.

Detailed progress 2005-5-15 to 2005-5-31, requirement analysis stage

2005-6-1 to 2005-6-10, detailed design stage

2005-6-11 to 2005-6-25, code writing stage

2005-6-26 to 2005-6-27, system testing phase

2.5 Fees

Program Fee:

Electricity fee: 100 yuan

Internet access fee: 60 yuan

Summer cooling fee: 100 yuan

Development period: 45 days

Actual cost:

Electricity fee: 100 yuan

Internet access fee: 60 yuan

Summer cooling fee: 100 yuan

Labor cost: 2000 yuan (5 yuan / machine hour)

Significantly more than expected

The main reason: the curriculum design course school charges 5 yuan/machine hour

Starts are not counted!

3 Development work evaluation

3.1 Evaluation of production efficiency

Making a relatively complete business website in 45 days shows that everyone is working hard.

3.2 Evaluation of product quality

Due to the lack of programming experience and the use of JSP this time, various errors will inevitably occur in the program, but fortunately, the team leader Han Qingbin has a high attainment in website construction and JSP, and many problems can be solved with his help , and finally finished the system! Although the function of this system still needs to be perfected, and the art is still relatively lacking, the basic operations can be realized, and we have tried our best to control the errors to a minimum. It can be said that this system has reached the standard of practical application.

3.3 Evaluation of technical methods

The system uses JSP+Access, there will be a certain lack of security in the system, which is caused by Access itself! At the beginning of the development, I wanted to use SQL SERVER or MYSQL as the background database of the system, but because I always made mistakes in the conversion of data types, I had to switch to Access! The security of JSP makes up for the lack of Access, and the platform independence of JAVA language is convenient for the promotion and use of this system! And new technologies such as JAVA BEAN are used in JSP.

3.4 Analysis of error causes

Most of the mistakes are caused by inexperience and carelessness in programming, and there are some other mistakes.

4 Experience and lessons

Through this system design, we understand the whole process of a website from requirement analysis to development testing and putting into use. Learn more about HTML web design, and get in touch with some new technologies and methods of website construction such as JSP and Java Bean. Through a specific design, I have a rational understanding of some knowledge, and have accumulated valuable experience for future study and work! And once again, we see the importance of requirements analysis and detailed design. Only correct requirements analysis can make marketable products, and a complete and good detailed design can make your coding more effective. Finally, we have emphasized the long-term team and Cooperation, we are one of the few people who completed the system design in a team. In the work, we help each other, promote each other, and learn from each other, which not only enriches your knowledge, but also cultivates your communication and communication skills!

item

eye

open

hair

count

Draw

1 Introduction 11

1.1 Writing purpose 11

1.2 Background 11

1.3 Definition 11

1.4 References 22

2 Project Overview 22

2.1 Job content 22

2.2 Main participants 22

2.3 Products 22

2.3.1 Procedure 22

2.3.2 Documentation 22

2.3.3 Services 22

2.3.4 Non-handover products 33

2.4 Acceptance criteria 33

2.5 Deadlines for completion of projects33

2.6 Approvers of this plan and date of approval 33

3 Implementation plan 33

3.1 Decomposition of work tasks and division of labor 33

3.2 Budget 33

3.3 Key issues 44

4 Support Conditions 44

4.1 Computer system support 44

4.2 Work to be undertaken by the user 44

5 Thematic Program Essentials 44

project development plan

1 Introduction

With the rapid development of computer and network technology, Internet/Intranet applications are becoming more and more popular all over the world. Today's society is rapidly advancing towards an information society, and the role of information automation is also increasing. Thus freeing us from complicated affairs and improving our work efficiency.

First of all, at present, the shopping malls in many large and medium-sized cities in China are still dominated by salespersons at the counter, which brings many management problems to the shopping malls; secondly, because the shopping malls are crowded areas, this also brings many problems to management and security. inconvenient. Third, e-commerce is currently in a period of rapid development, and most companies have fully implemented their own e-commerce plans, so establishing their own online sales platform is a top priority. Therefore, in order to solve these management and other problems, we urgently need a platform for commodity trading through the network. With the help of Internet/Intranet to provide us with timely and efficient processing information, this set of online shopping system has been developed.

1.1 Purpose of writing

The purpose of writing this software project development plan is to lay the foundation for the following outline design and detailed design, and to bring convenience to the maintenance of the system.

1.2 Background

  1. The name of the system to be developed is Mobile Sales System
  2. The task proposer of this project is the software system design instructor; the developer is the system design team, the members are: Han Qingbin, Zhao Dan, Xu Jianhui and Yu Shaofang; the user is the mobile phone sales mall, and the computing center or computer network that realizes the software has average capabilities can
  3. The software system is compatible with other Windows systems at the same time, which is convenient for management and maintenance.

1.3 Definition

The following are definitions of technical terms used in this document:

Mobile phone sales system order complaint

Customer Service News Center

my order cart

Cash register front desk management

Background management Member management

Mobile Sales Forum

1.4 References

1. "JSP Programming Examples Collection" edited by Ma Wengang and others Tsinghua University Press

2. "Database Principles and Technology", edited by Liu Fangxin, Electronic Industry Press

2Project Overview

2.1 Job content

The work to be done in the project development stage is the specific division of labor. Each team member specifies which module they are responsible for; what work and documents should be completed in a certain period of time.

This stage is more important. It lays the foundation for the next work and is related to the development of the entire system.

2.2 Main participants

The main personnel involved in the development of this project are: Han Qingbin (team leader), Zhao Dan, Xu Jianhui and Yu Shaofang.

2.3 Products

2.3.1 Procedure

When the system is completed, the name of the system handed over to the user is Mobile Phone Sales System v1.0, and the programming language used is JSP. The system is mainly divided into four modules: front desk management, background management, member management and mobile phone sales forum. Specifically, each module can realize the following functions: the front-end management needs to realize functions such as search engine, sales ranking, classification view, announcement, news, and friendship connection; the back-end management needs to realize product management, order management, and user management. , mobile phone category management, information management, routine management functions of adding, modifying and deleting; member management needs to realize the functions of member registration, order viewing, shopping cart, cash register, changing information, etc.; the function of mobile phone sales forum is to Including general forum functions, such as posting and replying to these basic functions.

2.3.2 Documentation

After the system is completed, it must be handed over to the user to pack the executable file or JSP file, run the necessary Tomcat and JDK programs, and explain how to configure the environment.

2.3.3 Services

When the system is completed, give users training on how to install, some simple maintenance and operation support. Counting from the date the system is delivered to the user, the software developer will provide the user with free system maintenance services within one year. After one year, system maintenance users must pay a certain amount of remuneration.

2.3.4 Non-handover products

Documents in the system development process do not need to be handed over to users, but are reserved for software developers to maintain.

2.4 Acceptance criteria

After the system is completed, the four modules of the system are verified separately, and the standard is to see whether it can complete the predetermined functions well. Security is very important. In addition to correctly querying, inserting, and deleting operations on the database, exception handling is very important, and it is required to be able to make corresponding exception handling according to different exceptions and errors. A good system must be able to do this well.

2.5 The latest deadline for the completion of the project

The system must be completed by 30 June 2005 at the latest.

2.6 Approver of this plan and date of approval

This plan was approved and implemented by the software system design instructor on May 23, 2005.

3 Implementation plan

3.1 Decomposition of work tasks and division of labor

For the four modules in the system, the specific division of labor is as follows:

Han Qingbin: Responsible for completing the mobile phone sales forum, requiring the basic functions of the forum to be realized, including posting and replying.

Zhao Dan: Responsible for front desk management. The basic functions required include search engine, sales ranking, category viewing, announcements, news, friendship links, etc.

Xu Jianhui: Responsible for background management. The basic functions required include product management, order management, user management, mobile phone category management, information management, routine management, etc.

Yu Shaofang: Responsible for member management. The basic functions required include member registration, order viewing, shopping cart, cash register, and data modification.

3.2 Budget

List the labor services required by the development project (including the number and time of personnel) and the budget of funds (including office expenses, travel expenses, machine time expenses, data expenses, rental of communication equipment and special equipment, etc.) and sources.

3.3 Key Issues

During the development of this project, the key issues are the rationality of the database design and the query, deletion, insertion and modification of the database.

4 Support conditions

4.1 Computer system support

The required computer system support, including computers, peripherals, communication equipment, simulators, compilers, operating systems, data management packages, data storage capabilities, and test support capabilities, are all general PC systems.

4.2 Work to be undertaken by the user

During the development of this project, the user's task is to keep in touch with the software developers at all times, and constantly reflect new requirements to the software developers, so that the software developers can make timely adjustments.

5 key points of the thematic plan

The development of the project has the following plans:

  1. The purpose of the developer training program is to deepen the professional level of developers and to be better competent for their jobs.
  2. The test plan catches as many bugs as possible before it is delivered to users.
  3. A user training program enables users to better use the system.
  4. The system installation plan configures the installation environment of the system.

need

beg

point

analysis

explain

bright

Book

【Abstract】 Through the construction of online shopping system to realize the information management of commercial retail enterprises. Established a B2C network sales system. The system function and realization, data flow and storage are discussed emphatically, including commodity catalogue, user registration, online ordering and shopping, stock query, background database management and so on.

Use key technologies such as HTML language, JavaScript technology, JSP and background database link to build an online shopping system. Realize the following functions of the online shopping system:

(1) Provide customers with 24-hour convenient and fast online ordering service.

(2) Maintenance and management of commodity information.

(3) Efficient commodity data scheme, scientifically and flexibly classify and store commodity information.

(4) Powerful, convenient and fast query.

(5) Order number module.

(6) Integrate customer business logic rules into the system, that is, provide different payment methods according to different customer attributes.

(7) Order management.

【Key words】 B2C, online shopping system, JSP, database

I. Introduction

  1. purpose of writing

The following is a further analysis of the current status of online shopping based on the China B2C E-commerce Development Report released by CNNIC (China Internet Network Information Center). (Mainly refer to the analysis chart in it)

Due to the above advantages, e-commerce is developing very rapidly in our country, and it has become a very popular field. This demand statement is written for those individuals who want to enter e-commerce. You can decide whether it is It is a field worth entering and what conditions you need.

1.2 Background

System name: JSP online shopping system (mobile phone sales system)

Development Team Members: Team Leader: Han Qingbin Team Members: Xu Jianhui, Zhao Dan, Yu Shaofang

Division of labor among members:

: Forum

: Backstage management

: front desk management

: shopping cart

1.3 Definition

HTML language:

HTML (Hyper Text Markup Language) is a simple markup language used to make hypertext documents. Unlike common word processing documents, web pages are formatted in hypertext markup language. HTML files are standard text files with specific HTML insertion tags for document properties and formatting. It can be independent of various operating system platforms (such as UNIX, WINDOWS, etc.). Since 1990, HTML has been used as an information representation language on the World Wide Web to describe the format design of a Homepage and its link information with other Homepages on the WWW.

JavaScript technology:

JavaScript is an object-based (Object) and event-driven (Event Driven) scripting language with security performance. The purpose of using it is to realize linking multiple objects in a Web page together with HTML hypertext markup language and Java scripting language (Java applet), and to interact with Web clients. This enables the development of client-side applications and the like. It is implemented in the standard HTML language by embedding or calling in. Its appearance makes up for the defects of the HTML language, and it is a compromise between Java and HTML

JSP:

JSP (Java Server Pages) is a dynamic web technology standard initiated by Sun Microsystems and established by many companies. JSP technology uses the JAVA language as the scripting language, and the JSP web page provides an interface for the entire server-side JAVA library unit to serve HTTP applications.

Database principle:

① Brief introduction of SOL language

SQL is the abbreviation of English Structured Query Language, which means Structured Query Language.

  The main function of the SQL language is to establish connections and communicate with various databases. According to ANSI (American National Standards Institute), SQL is used as a standard language for relational database management systems. SQL statements can be used to perform various operations such as updating data in a database, extracting data from a database, etc.

② JDBC, ODBC technology introduction

JDBC
----JDBC (Java DataBase Connectivity) is an interface specification between Java and databases. JDBC defines a general low-level application programming interface (API) that supports standard SQL functions. It consists of classes and interfaces written in Java language. It is designed to allow database developers to provide standard database APIs for Java programmers. The JDBC API defines several classes in Java, representing database connections, SQL commands, result sets, database metadata, and more. It allows Java programmers to send SQL commands and process the results. Through the driver manager, JDBC API can use different drivers to connect to different database systems. .

ODBC
---- ODBC (Open DataBase Connectivity) is an application programming interface (API) advocated by Microsoft and widely accepted by the industry for database access. It uses X/Open and ISO/IEC call-level interface ( CLI) specification and uses Structured Query Language (SQL) as its database access language. The overall structure of ODBC has four components:
---- The application performs processing and calls ODBC API functions to submit SQL statements and retrieve results.

---- Driver Manager (Driver Manager) According to the application needs to load / unload the driver, handle ODBC function calls, or send them to the driver.

---- The driver processes ODBC function calls, submits SQL requests to a specified data source, and returns the results to the application. If necessary, the driver modifies an application request to conform to the syntax supported by the associated DBMS.

---- The data source includes the data that the user wants to visit and its related operating system, DBMS and network platform for accessing the DBMS.

③ Access database

Access is a database management system. The reason why it is integrated into Office instead of Visual Studio is that it is easier to learn than other database management systems (such as Visual FoxPro), and an ordinary computer user can master it and learn it. use it. And the most important point is that the function of Access is powerful enough to meet the needs of general data management and processing.

1.4 References

Book information:

"JSP Practical Programming Examples Collection" Tsinghua University Press Ma Wengang et al.

"Java Case Development" edited by Zhang Liang, China Water Conservancy and Hydropower Publishing House, etc.

"Design and Realization of E-Commerce Website" Journal of Huaqiao University Yan Guilan, Liu Jiayao

Reference and Professional Websites

http://www.cnjsp.org

http://mobile.163.com/

2. Task overview

2.1 Goals

The main functions of a typical B2C e-commerce online ordering system are:

(1) Provide customers with 24-hour convenient and fast online ordering service.

(2) Maintenance and management of product information, including price adjustment, modification of existing product information, addition of new product information, deletion of outdated product information, etc.

(3) Efficient commodity data scheme, scientifically and flexibly classifying and storing commodity information, so that customers can quickly find the commodities they need from as few as tens of thousands, as many as hundreds of thousands or even millions of commodities.

(4) Powerful, convenient and fast query function. Provide keyword queries (eg: find all "Electronic Cannon" products).

(5) Order number module The so-called order number module means that after the customer purchases the product, the system automatically assigns a shopping number to the customer, so that the customer can check the bill processing status at any time. Know the current status of the goods.

(6) Integrate customer business logic rules into the system, that is, provide different payment methods according to different customer attributes. (such as credit card, check, etc.)

(7) Order management. Provide data interface for distributor's EPR system. Administrators can view history, order status, and be able to notify users in the shortest possible time.

2.2 User Features

This system is easy to operate and requires low configuration, it is suitable for beginners who want to build their own e-commerce website! No professional knowledge is required, the maintenance is simple, and we will provide online upgrade, question answering and other related services!

2.3 Assumptions and constraints

Development costs:

Electricity fee: 100 yuan

Internet access fee: 60 yuan

Summer cooling fee: 100 yuan

Development period: 45 days

3. Requirements

3.1 Specifications for functions

3.2 Provisions for 3.2 Performance

The main problems that users think there are in current online transactions:

Figure 3 Users think the biggest problem existing in online transactions

From the graph above, it can be seen that the two most serious problems at present are security and product service. Therefore, the security of transactions is what our system emphasizes!

4. Operating environment regulations

Since we are targeting primary users, we don't have high requirements for the system! But for the stable operation of the website, we recommend using a professional server!

This system has good compatibility, which fully embodies the universality of Java and Access! It can run stably on the WINDOWS operating system above WIN98 or WIN NT3.0, and supports various versions of UNIX and LINUX operating systems at the same time!

Good support for all kinds of general and professional software, and the online service system will solve the difficulties you encounter at any time!

number

according to

library

set up

count

explain

bright

Book

Database Design Specification

1. Introduction

  1. 1 Purpose of writing

The purpose of writing this document is to list the data objects in the database and the relationship between the data objects in the form of documents, to explore reasonable database design specifications, reduce data redundancy, and realize efficient and accurate data query and data connection of the database Work, and assist and standardize the work of the members of the software course design team.

The expected readers of this requirement are decision makers related to the software development of the learning performance management system, development team members, support developers, leaders and company personnel who support the project, and software verifiers.

  1. 2 background

The name of this database is Mobile Phone Sales System Database;

The software system using this database is a mobile sales system;

The task proposer is all members of the mobile phone sales system production team;

The user is a certain mobile phone sales company;

The computing station where the software and the database will be installed is the so-and-so mainframe of the so-and-so mobile phone sales company.

  1. 3Definition
    a .. Database ----- refers to a collection of generalized, comprehensive, structured and shareable data stored in the computer system for a long time, with small data redundancy and high data independence, security and integrity.
    b.  ER Diagram——a graphical representation of the ER data model, which is a powerful tool for visually representing the real world. At present, ER diagrams have been widely used in the conceptual design of databases.
    1.4 Reference material
    "Software Engineering---Principles, Methods and Applications" Second Edition
    "Database Principles and Technology" Higher Education Press, edited by Liu Fangxin Electronic Industry Press
    2. Data analysis
    2.1 The composition of data entities
    The data consists of 9 entities, They are
    administrator; shopping cart; mobile phone; member; news; news classification; mobile phone brand; mobile phone classification; order.
    2.2 Entity Analysis
    1. Administrator Entity Analysis
    Administrator

    . 2. Shopping Cart Entity Analysis
    Shopping Cart

    3. Mobile Phone Entity Analysis
    Mobile Phone

    4. Member Entity Analysis
    Member

    5. News Entity Analysis
    News

    6. News Category Entity Analysis
    News Category

    7. Mobile Brand Entity analysis
    Mobile phone brand

    8. Mobile phone classification entity
    Mobile phone classification

    9. Order entity
    Order

    management
    2.3 ER diagram analysis
    Administrator
    Other entity

    checkout
    Shopping cart
    Order

    3. Database specific design
    3.1 Database
    composition The database consists of 9 tables (excluding other affiliated tables), which are
    admin: administrator;
    basket: shopping cart;
    hw: mobile phone;
    member: member;
    news: news;
    newsclass: news classification;
    sort: brand classification;
    Nsort: mobile phone classification;
    Sub: order
    1: admin table:
Field Name type of data illustrate
Admin-id CHAR admin number, primary key
Admin-name CHAR admin name
Admin-pass CHAR administrator password


2: basket table:

Field Name type of data illustrate
Basket-id CHAR shopping cart number, primary key
Hw-id CHAR mobile phone number
username CHAR customer name
Basket-count CHAR shopping quantity
Basket-date TIME/DATE shopping date
Basket-check CHAR processing information
cash CHAR mobile phone price
Sub-number CHAR order number
Hw-name CHAR phone name


3: hw table

Field Name type of data illustrate
Hw-id int mobile phone number
Sort-id int brand number
Nsort_id int Brand phone number
Hw_name char phone name
Hw_cash int price
Hw_content char describe
Hw_buys int Number of purchases
Hw_date char Date of manufacture
Hw_pic char phone picture


4: member table

Field Name type of data illustrate
User-id INT membership number
Username CHAR username
Userpass CHAR password
Usermail CHAR Mail
Useraddr CHAR address
Usertel CHAR Telephone
Userregtime TIME/DATE Registration time
Userregip CHAR IP when registering
Userlastip CHAR Last login IP
Userlasttime TIME/DATE last login time
Userturename CHAR member real name
Usertype CHAR Type of membership


5: new table

Field Name type of data illustrate
News-id INT news number
Newclass-id INT 新闻类型编号
News-title CHAR 新闻标题
News-content CHAR 新闻内容
News-time TIME/DATE 新闻时间


6:newsclass表

字段名称 数据类型 说明
Newsclass-id INT 新闻类型编号
Newsclass-name CHAR 新闻类型名称


7:sort表

字段名称 数据类型 说明
Sort-id INT 品牌编号
Sort-name CHAR 品牌名称


8:nsort表

字段名称 数据类型 说明
Nsort-id INT 品牌手机编号
Nsort-name CHAR 品牌手机名称
Sort-id INT 品牌编号


4.运用设计
4.1 数据字典
传统的数据字典包括以下几种类型的条目:

    1. .数据流条目--数据流条目给出某个数据流和定义,它通常是列出该数据流的各组成数据元素。

该系统中的数据流条目有:

管理员=管理员编号+管理员姓名+管理员密码

购物车=购物车编号+手机编号+手机数目+客户姓名+购买日期

手机信息=手机编号+手机名称+品牌类型+手机描述+出厂日期+出售数目

会员信息=会员编号+用户名+密码+用户基本信息+注册时间及IP+最后登陆时间及IP。

(2).文件条目--文件条目给出某个文件的定义,列出它的组成数据项,此外还要给出文件的组织形式。

例:手机信息文件={手机基本信息记录}+{手机购买记录}

主键:手机编号+客户编号

(3).数据元素条目--给出某个数据单项的定义,通常是数据项的值类型。

例:手机基本信息记录中“手机编号”的数据值类型为数值类型,有效值范围为000000~999999。

(4).处理说明条目--给出数据流程图中不再分解的变换处理说明的定义。

此处不再举例说明。

4.2 数据库安全设计

本数据库采用Acess 平台的安全验证机制,能很大程度上保证数据的安全,可以很好的防止数据的泄露,数据在编程时的毁坏。由于Acess与Windows很好的兼容性,可以很好的保证数据的运行安全。

4.3 性能要求

1. 数据精确度

由于采用数据库技术并且用户的应用领域对数据精确度的要求不是太高,所以这点在系统中表现得比较少,但是用户数据的安全性与正确性是完全保证的,所以对用户的使用没有多大的障碍。

2. 时间特性

本系统的数据库较小,所以程序在响应时间,数据更新处理时间上性能是比较突出的。而且也正由于数据量相对较少,故在数据传输时间和系统运行时间上表现的较让人满意。

3. 适应性

该数据库是使用Acess2000在windows xp系统下完成的所以只要是兼容windows的软件或是操作系统,该软件都可以正确地运行,有较好的适应能力与兼容性。而且应用户的特殊需求软件在完成后的维护阶段可以保持一个与其他类软件接口,随时满足用户的使用要求。

操作手册(GB8567——88)

1引言

1.1编写目的

编写这份操作手册的目的是方便选择本系统客户的使用,使大家能够最好的使用本系统的各项功能,发挥出它的每一个闪光点!同时也为本系统的维护提供方便,操作人员或维修人员可以据此进行错误的排查,还有就是可以通过用户对各功能的使用,发现系统的不足,促进我们后继版本的完善,当然我们会提供在线升级,发布相关的补丁。

1.2前景

系统名称:JSP网络购物系统(手机销售系统)

开发小组成员:组长:韩庆宾 组员:徐剑辉,赵丹,俞少坊

各成员分工:

韩庆宾: 论坛

徐剑辉: 后台管理

赵丹: 前台管理

俞少坊: 购物车

2软件征述

2.1软件的结构

本软件为C/S模式,整个网上购物的流程如下图:

3运行说明

本系统为网络模式,要正常提供服务应首先开启服务器。这样才可以打开网页。

由于我们采用的是tomcat5.5.4为测试服务器,现在就以它为例讲解。

一、首先安装tomcat5.5.4,假设安装路径为E:\tomcat5.4

二、安装jdk1.5.1,安装目录尽量保持跟tomcat的路径相同。E:\jdk1.5.1

三、修改环境变量:右击"我的电脑"-->"属性"-->"高级"-->"环境变量"

在系统变量中添加如下变量及值:

TOMCAT_HOME 值为E:\tomcat5.4

CATALINA_BASE 值为E:\tomcat5.4

CATALINA_HOME 值为E:\tomcat5.4

JAVA_HOME 值为E:\jdk1.5.1

classpath 值为.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME% \common\lib\servlet-api.jar;

path 值为%JAVA_HOME%\bin

四、设置数据源。在数据源设置中设置两个数据源shnxn为手机销售系统的数据库db.mdb数据源bbs为论坛的数据库bbs.mdb.

五、在浏览器中输入http://localhost:8080/出现tomcat公司的页面即为成功。

3.1前台管理

首先进入网站主页。本机测试(http://localhost:8080/jspshop)

外网测试(http://服务器IP:8080/jspshop)

你会看到如下的页面 (图 1)

在主页上你可以登陆会员,也可以在各手机专区间相互跳转,查看一些信息(不要求会员权限的)。

并且在前台有各手机的销售排行,你还可以搜索你所感兴趣的产品,例如:你可以在搜索的文字录入处写6600,然后点击搜索,NOKIA 6600符合要求就会显示出来,如果有你需要的,点击它就会转到相应的产品页面。(图2)

图 1

图 2

3.2购物车

当用户登陆以后,如果选中要购买的产品,就点击改产品下方的“订购”

会出现如下界面(图3)

ZD是当前的购物人,购物车包含所选商品的基本信息,订购数量为一下拉列表,

方便购物者的选择。

图 3

确定购买的数量后,店击确认,返回如图4所示界面:

信息包括 订购的商品名称 单价,数量,日期以及合计价格。

图 4

3.3后台管理

首先进入后台管理页面

本地地址(http://localhost:8080/jspshop/admin/manage.jsp

外网地址(http://服务器IP:8080/jspshop/admin/manage.jsp)

所有后台对数据库的操作在这都可以完成

图5为添加新商品的界面

图 5

手机销售系统详细设计说明

1引言22

1.1编写目的22

1.2背景22

1.3定义22

1.4参考资料22

2程序系统的结构22

3会员管理设计说明44

3.1程序描述44

3.2功能99

3.3性能99

3.4输入项99

3.5输出项1010

3.6流程逻辑1010

4后台管理设计说明1010

4.1程序描述1010

4.2功能描述1414

4.3性能1414

4.4输入项1515

4.5输出项1515

4.6流程逻辑1515

5前台设计说明1616

5.1程序描述1616

5.2功能描述1818

5.3性能1818

6销售论坛设计说明1818

6.1程序描述1919

6.2功能描述2525

6.3性能描述2525

详细设计说明书

1引言

1.1编写目的

本说明书主要是针对程序设计人员的而写的,程序设计人员以后详细设计为参考编写网站程序。

1.2背景

说明:

  1. 待开发软件系统的名称:手机销售系统。
  2. 项目经理:韩庆宾

小组成员:赵丹、徐建辉、俞少坊

1.3定义

JSP、JAVABEAN、TOMCAT、SQL。

1.4参考资料

参考资料:JSP设计教程、javabean和serverlet等。

2程序系统的结构

功能模块图

购物流程图

子功能模块图

  1. 会员功能
    功能包括(会员注册、订单查看、购物车、收银台、更改资料)
  2. 后台管理
    功能包括(商品管理、订单管理、用户管理、手机类别管理、信息管理、常规管理)
  3. 前台信息
    功能包括(搜索引擎、销售排行、分类查看、公告、新闻、友情连接)
  4. 客户论坛

论坛的基本功能都要实现。

3会员管理设计说明

3.1程序描述

一、注册功能:

1.图示

2.主要程序:

<%

String errmsg="错误!";

boolean founderr=false;

String user_name,user_pass,user_pass2,user_adds,user_tel,user_mail,user_postcode;

user_name=errmsg;

user_pass=errmsg;

user_pass2=errmsg;

user_adds=errmsg;

user_tel=errmsg;

user_mail=errmsg;

user_postcode=errmsg;

if(request.getParameter("user_name").equals("")){

errmsg=errmsg+"用户名不能为空,";

founderr=true;

}else user_name=getStr(request.getParameter("user_name"));

if(request.getParameter("user_pass").equals("")){

errmsg=errmsg+"密码不能为空,";

founderr=true;

}else user_pass=getStr(request.getParameter("user_pass"));

if(request.getParameter("user_pass2").equals("")){

errmsg=errmsg+"密码确认不能为空,";

founderr=true;

}else user_pass2=getStr(request.getParameter("user_pass2"));

if(!user_pass.equals(user_pass2)){

errmsg=errmsg+"两次密码不同!";

founderr=true;

}

if(request.getParameter("user_adds").equals("")){

errmsg=errmsg+"地址不能为空,";

founderr=true;

}else user_adds=getStr(request.getParameter("user_adds"));

if(request.getParameter("user_tel").equals("")){

errmsg=errmsg+"电话号码不能为空,";

founderr=true;

}else user_tel=getStr(request.getParameter("user_tel"));

if(!IsMail(request.getParameter("user_mail"))){

errmsg=errmsg+"你的E-mail有错误,";

founderr=true;

}else user_mail=getStr(request.getParameter("user_mail"));

if(request.getParameter("user_postcode").equals("")){

errmsg=errmsg+"邮编不能为空,";

founderr=true;

}else user_postcode=getStr(request.getParameter("user_postcode"));

sql="select * from member where user_name='"+user_name+"'";

rs=mdb.executeQuery(sql);

if(rs.next()){

errmsg=errmsg+"用户名已被别人注册";

founderr=true;

}

%>

<div align="center">

<center>

<table border="0" width="500" cellspacing="0" cellpadding="0" height="5" style="border-collapse: collapse" bordercolor="#111111">

<%if(founderr==false){

String sql1;

sql1="Insert into member(user_name,user_pass,user_adds,user_mail,user_tel,user_regip,user_namec,user_type) values('"+user_name+"','"+user_pass+"','"+user_adds+"','"+user_mail+"','"+user_tel+"','"+request.getRemoteHost()+"','"+getStr(request.getParameter("user_namec"))+"','会员')";

mdb.executeInsert(sql1);

%>

二、购物车

1.图示:

2.主要程序:<jsp:useBean id="mdb" class="ckstudio.db.faq" scope="page"/>

…………………………

<%

String user_name=(String)session.getValue("user_name");

String user_type=(String)session.getValue("user_type");

if(user_name!=null)

{

%>

<%=user_name%>的购物车

……………………….

{//having login check

int hw_id;

String hw_ids=request.getParameter("hw_id");

if(hw_ids==null)

{

out.print("没有此货物");

}

else

{//hw_id exists or not--------------------------------------------------------------

hw_ids.trim();

ResultSet rs;

int daili;

hw_id=Cint(hw_ids);

sql="select * from hw where hw_id="+hw_id;

rs=mdb.executeQuery(sql);

if(rs.next())

{

//result showing begin ------------------------------------------

hw_cash=rs.getInt("hw_cash");

daili=rs.getInt("daili");

hw_name=rs.getString("hw_name");

%>

三、收银台

1.图示:

2.主要程序:String sql="select * from basket where hw_id='"+hw_id+"' and user_name='"+(String)session.getValue("user_name")+"' and basket_check=false";

ResultSet rs;

rs=mdb.executeQuery(sql);

if(!rs.next()){

String sql1="insert into basket(hw_id,user_name,basket_count,hw_name,hw_cash,user_type) values('"+hw_id+"','"+session.getValue("user_name")+"','"+count+"','"+request.getParameter("hw_name")+"','"+request.getParameter("hw_cash")+"','"+request.getParameter("user_type")+"') where hw_id='"+hw_id+"' and user_name='"+session.getValue("user_name")+"' and basket_check=false";

mdb.executeInsert(sql1);

}

else{

//rs("basket_count")=int(rs("basket_count"))+int(count)

rs.next();

int basket_count=Integer.parseInt(rs.getString("basket_count"));

basket_count=basket_count+Integer.parseInt(count);

String basket_count2=Integer.toString(basket_count);

String sql2="update basket set basket_count='"+basket_count+"'";

mdb.executeUpdate(sql2);

}

}

四、用户资料修改

1.图示:

2.主要程序:

user_name=request.getParameter("user_name");

sql="select * from member where user_name='"+user_name+"'";

ResultSet rs;

rs=mdb.executeQuery(sql);

if(rs.next()){

rs.updateString("user_pass",user_pass);

rs.updateString("user_mail",user_mail);

rs.updateString("user_adds",user_adds);

rs.updateString("user_postcode",user_postcode);

rs.updateString("user_tel",user_tel);

rs.updateString("user_namec",user_namec);

rs.updateRow();

out.print("<font>");

out.print("用户资料更改完毕,请记牢你更改后的信息");

out.print("</font>");

rs.close();

3.2功能

功能包括(会员注册、订单查看、购物车、收银台、更改资料)

3.3性能

要求把各种异常处理情况都要考虑到并返回相应的结果,比方说如果两次输入的密码不相同则要返回“两次输入的密码不相同”的结果。

3.4输入项

用户注册

字段名称 数据类型 说明
User-id INT 会员编号
Username CHAR 用户名
Userpass CHAR 密码
Usermail CHAR 邮箱
Useraddr CHAR 地址
Usertel CHAR 电话
Userturename CHAR 会员真名

3.5输出项

判断输入的数据是否正确,如果有错误就转入err.jsp并显示出错误项,如果数据正确则注册成功。

3.6流程逻辑

4后台管理设计说明

4.1程序描述

一、商品管理

商品管理主要包括:添加新的商品、商品分类管理、商品查看与修改、商品定单管理(未实现)

  1. 图示:①添加新商品


②商品修改

  1. 主要程序:

①添加新商品<%

if(request.getParameter("action")!=null)

{//-----------------------------------action=save-----------------------------------------------------

if(request.getParameter("action").equals("save"))

{

String hw_name=request.getParameter("hw_name");

………………………..

String errmsg="输入有错!";

boolean founderr=false;

if(Cint(hw_cashs)==0)

{

errmsg="<br>"+"<li>价格应该为数字";

founderr=true;

}

…………………………..

if(month>12||day>31||month<=0||day<=0){

errmsg=errmsg+"<br>"+"<li>产品生产日期格式不正确";

founderr=true;

}else{

datas=new Date(year-1900,month-1,day);

}else

{

hw_name=getStr(hw_name);

company=getStr(company);

hw_content2=encode(getStr(hw_content2));

hw_content=encode(getStr(hw_content));

boolean btuijian=false,bjia=false;

if(tuijian.equals("1")){ btuijian=true;}

if(jia.equals("1")){ bjia=true;}

sql="insert into hw (hw_name,hw_content,hw_content2,hw_cash,sort_id,Nsort_id,company,daili,pifa,hw_sn,chubsh,kaiben,yeshu,";

sql=sql+"data,isbn,zhuang,hw_pic,tuijian,jia)";

sql=sql+"values('"+hw_name+"','"+hw_content+"','"+hw_content2+"',"+Cint(hw_cashs)+","+Cint(sort_ids)+","+Cint(Nsort_ids);

sql=sql+",'"+company+"',"+Cint(dailis)+","+Cint(pifas)+",'"+hwsn+"','"+chubsh+"','"+kaiben+"','"+yeshu+"','"+datas.toLocaleString()+"','"+isbn;

sql=sql+"','"+zhuang+"','"+hw_pic+"',"+btuijian+","+bjia+")";

mdb.executeInsert(sql);

out.print("货物添加成功");

out.print("<br>");

out.print("<a href=addhw.jsp>返回</a>");

②商品修改

sql="update hw set hw_name='"+hw_name+"',hw_content='"+hw_content+"',hw_content2='"+hw_content2;

sql=sql+"',hw_cash="+hw_cash+",sort_id="+sort_id+",company='"+company+"',daili="+daili+",pifa="+pifa;

sql=sql+",hw_sn='"+hw_sn+"',chubsh='"+chubsh+"',kaiben='"+kaiben+"',yeshu='"+yeshu+"',data='"+data.toLocaleString()+"',isbn='"+isbn;

sql=sql+"',zhuang='"+zhuang+"',hw_pic='"+hw_pic+"',Nsort_id="+Nsort_id+",tuijian="+tuijian+" where hw_id="+hw_id;

mdb.executeUpdate(sql);

out.print("商品修改成功!");

二、订单管理(时间有限未能实现)

三、用户管理

用户管理主要是查看和删除用户,提升用户为VIP用户的功能。

  1. 图示
    ①查看用户

  1. 主要程序:

①查看用户:

while(rs.next()&&i<=PageSize){

i++;

int user_id=rs.getInt("user_id");

String user_mail=rs.getString("user_mail");

String user_name=rs.getString("user_name");

String user_adds=rs.getString("user_adds");

String user_postcode=rs.getString("user_postcode");

Date user_regtime=rs.getDate("user_regtime");

String user_type=rs.getString("user_type");

%>

②删除用户:

<%@ include file="conn.jsp"%>

<%

if(request.getParameter("action").equals("deluser")){

int user_id=Integer.parseInt(request.getParameter("user_id"));

sql="select * from member where user_id="+user_id+"";

rs=mdb.executeQuery(sql);

if(!rs.next())

out.print("<center>用户信息已删除!");

else{

sql="delete from member where user_id="+user_id+"";

mdb.executeDelete(sql);

out.print("<center>用户信息已删除!");

}

}

mdb.Close();}

%>

③提升权限:

<%@ include file="conn.jsp"%>

<%

if(request.getParameter("action").equals("up")){

int user_id=Integer.parseInt(request.getParameter("user_id"));

sql="select user_type from member where user_id="+user_id+"";

rs=mdb.executeQuery(sql);

if(!rs.next())

out.print("<center>没有此用户信息!");

else{

sql="update member set user_type='VIP' where user_id="+user_id+"";

mdb.executeUpdate(sql);

out.print("用户升级为VIP会员成功!");

}

}

mdb.Close();

}

%>

四、商品分类管理、信息管理、和常规管理其原理跟上面的是一样的,只是所操作的数据表不同,在这里就不一一列出。

4.2功能描述

后台管理只要是管理员来操纵的,管理员登录以后可以控制所有相关的数据库内容,主要功能为商品管理(商品的添加、修改、删除、信息查看、商品的分类管理(分两类一个大类一个小类))订单管理(查看和处理客户的订单)、用户管理(查看、删除用户、提升用户权限)、信息管理(网站的一些基本信息)、常规管理

4.3性能

最重要要有相应的异常处理功能,对一些不正常的数据要返回错误

4.4输入项

添加商品:

字段名称 数据类型 说明
Hw-id int 手机编号
Sort-id int 品牌编号
Nsort_id int 品牌手机编号
Hw_name char 手机名
Hw_cash int 价格
Hw_content char 描述
Hw_buys int 购买次数
Hw_date char 出厂日期
Hw_pic char 手机图片

添加新闻:

字段名称 数据类型 说明
News-id INT 新闻编号
Newclass-id INT 新闻类型编号
News-title CHAR 新闻标题
News-content CHAR 新闻内容
News-time TIME/DATE 新闻时间

4.5输出项

根据程序中的判断,如果数据不相符就返回相应的结果。如果相符就返回添加成功。所有的错误类型都包含在err.jsp中。

4.6流程逻辑

5前台设计说明

5.1程序描述

搜索引擎、销售排行、分类查看、公告、新闻、友情连接

一、搜索引擎

  1. 图示

2、主要程序:<%String hw_name,sort_id;

if(session.getAttribute("sort_id")==null){

hw_name=getStr(request.getParameter("hw_name"));

sql="select * from hw where hw_name like '%"+hw_name+"%' order by hw_id DESC";

rs=mdb.executeQuery(sql);

}

else{

sort_id=request.getParameter("sort_id");

hw_name=getStr(request.getParameter("hw_name"));

sql="select * from hw where sort_id='"+sort_id+"' and hw_name like '%"+hw_name+"%' order by hw_id DESC";

rs=mdb.executeQuery(sql);

}

if(!rs.next()){

%>

<tr>

<td width="380">没有你要找的商品,请先确定商品的类别</td>

</tr>

<%}

else{rs.previous();

%>

二、销售排行

  1. 图示

2、主要程序<%

sql="select top 11 * from hw order by hw_buys DESC";

rs=mdb.executeQuery(sql);

if(!rs.next())

{

out.print("本站目前没有成交任何商品");

}else

{

rs.previous();

i=0;

int hw_id,daili;

String hw_name;

while(rs.next()&i<=10){

hw_id=rs.getInt("hw_id");

hw_name=rs.getString("hw_name");

daili=rs.getInt("daili");

%>

三、主要页面

图示:

5.2功能描述

前台设计主要是美工方面的、使用Dreamweaver MX设计界面,要求风格统一,色彩鲜明能勾起顾客的购买欲望,同时网站结构也要分明,是顾客很容易就可以找到想要的商品。网站设计方面我们基本上做到了以上几点。

5.3性能

网页的布局要合理,使人有一目了然的感觉。颜色搭配要合理,不要让人有杂乱的感觉。

6销售论坛设计说明

论坛设计实现了论坛的一些基本功能,

用户功能:用户注册、发表新贴、回复帖子、个性签名(可以自己控制显不显示)、资料修改、搜索帖子、查看在线用户、联系用户。

管理员功能:管理版块、管理用户、帖子编辑(删除、修改)、管理斑竹。

6.1程序描述

由于程序庞大,在这里只列出了部分主要程序:

  1. 数据库连接的javabean 编译后的文件名jdbc.class

package bbsclass;

import java.io.*;

import java.sql.*;

public class jdbc {

public jdbc() {

}

Connection conn = null ;

public java.sql.Connection getConn(){

try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

conn= DriverManager.getConnection("jdbc:odbc:bbs");

}

catch(Exception e){

e.printStackTrace();

System.out.println("hanqingbin");

}

return this.conn ;

}

public String ex_chinese(String str){

if(str==null){

str ="" ;

}

else{

try {

str = new String(str.getBytes("iso-8859-1"),"gb2312") ;

}

catch (Exception ex) {

}

}

return str ;

}

public String getTime() {

String datestr = "" ;

try {

java.text.DateFormat df = new java.text.SimpleDateFormat("yyyy-M-d HH:ss") ;

java.util.Date date = new java.util.Date() ;

datestr = df.format(new java.util.Date()) ;

}

catch (Exception ex) {

}

return datestr ;

}

}

二、在线用户状态:showonline.jsp

<%

Guest_List="";

User_List="";

Connection con=yy.getConn();

Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

ResultSet rs=null;

sql="select * from 在线 where 在线id='"+session.getId()+"'";

rs=stmt.executeQuery(sql);

rs.last();

if (rs.getRow()>0)

{

if (session.getValue("UserName")==null)

sql="update 在线 set 在线后面时间='"+yy.getTime()+"',在线最后时间='"+DateToString()+"' where 在线id='"+session.getId()+"'";

else

sql="update 在线 set 在线用户名='"+session.getValue("UserName")+"',在线后面时间='"+yy.getTime()+"',在线最后时间='"+DateToString()+"' where 在线id='"+session.getId()+"'";

stmt.executeUpdate(sql);

}else

{

sql="insert into 在线(在线id,在线用户名,在线开始时间,在线后面时间,在线最后时间,在线IP地址) ";

if (session.getValue("UserName")==null)

sql=sql+" values('"+session.getId()+"','客人','"+yy.getTime()+"','"+yy.getTime()+"','"+DateToString()+"','"+request.getRemoteAddr()+"')";

else

sql=sql+" values('"+session.getId()+"','"+session.getValue("UserName")+"','"+yy.getTime()+"','"+yy.getTime()+"','"+DateToString()+"','"+request.getRemoteAddr()+"')";

//out.println(sql);

stmt.executeUpdate(sql);

}

Time_Str=DateToString();

Online_Time=Integer.parseInt(Time_Str);;

Online_Time=Online_Time-60;

sql="delete from 在线 where 在线最后时间<'"+Online_Time+"'";

stmt.executeUpdate(sql);

//out.println(Online_Time);

sql="select 在线用户名 from 在线 where 在线用户名<>'客人' order by 在线最后时间 desc";

rs=stmt.executeQuery(sql);

rs.last();

User_Num=rs.getRow();

if (User_Num>0)

{

for (int i=1;i<=User_Num;i++)

{

UserName=rs.getString("在线用户名");

User_List=User_List+"<a href=member.jsp?member="+UserName+">"+UserName+"</a>&nbsp;&nbsp";

}

}

sql="select 在线用户名 from 在线 where 在线用户名='客人' order by 在线最后时间 desc";

rs=stmt.executeQuery(sql);

rs.last();

Guest_Num=rs.getRow();

if (Guest_Num>0)

{

for (int i=1;i<=Guest_Num;i++)

{

Guest_List=Guest_List+"客人&nbsp;&nbsp";

}

}

%>

三、帖子查询:search.jsp

//out.println(S_Member);

if ((S_Member==null) || (S_Member.equals("null")))

{

//out.println("OK");

if (S_Time.equals("0"))

Time_Sql="";

else

Time_Sql=" datediff('d',[发表日期],now()) < "+S_Time+" and ";

if (S_User.equals(""))

User_Sql="";

else

User_Sql=" 贴子作者='"+S_User+"' And";

if (S_Board.equals("all"))

Board_Sql="";

else

Board_Sql=" 版块id="+S_Board+" And";

if (S_Area.equals("content"))

sql="Select * from 贴子 Where "+Time_Sql+User_Sql+Board_Sql+" 贴子内容 like '%"+S_Key+"%' order by 贴子id desc";

else if (S_Area.equals("title"))

sql="Select * from 贴子 Where "+Time_Sql+User_Sql+Board_Sql+" 贴子名称 like '%"+S_Key+"%' order by 贴子id desc";

else if (S_Area.equals("both"))

sql="Select * from 贴子 Where "+Time_Sql+User_Sql+Board_Sql+" 贴子内容 like '%"+S_Key+"%' or "+Time_Sql+User_Sql+Board_Sql+" 贴子名称 like '%"+S_Key+"%' order by 贴子id desc";

}else

{

sql="Select * from 贴子 Where 贴子作者='"+S_Member+"'";

//sql="Select * from 贴子 Where 贴子作者='admin'";

}

//out.println(sql);

String fid=request.getParameter("fid");

Connection con=yy.getConn();

Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

ResultSet rs=null;

rs=stmt.executeQuery(sql);

rs.last();

RecordCount=rs.getRow();

PageCount=(RecordCount % PageSize==0)?(RecordCount/PageSize):(RecordCount/PageSize+1);

String Page=request.getParameter("page");

if (Page!=null)

{

ShowPage=Integer.parseInt(Page);

if (ShowPage>PageCount)

ShowPage=PageCount;

else if(ShowPage<0)

ShowPage=1;

}else

ShowPage=1;

if (RecordCount>0)

{

rs.absolute((ShowPage-1)*PageSize+1);

for (int i=1;i<PageSize;i++)

{

Note_Id=rs.getString("回复id");

if (Note_Id.equals("0"))

Note_Id=rs.getString("贴子id");

Note_Name=rs.getString("贴子名称");

Note_Author=rs.getString("贴子作者");

Replay_Name=rs.getString("回复用户");

Replay_Time=rs.getString("回复时间");

Forum_Id =rs.getString("版块id");

%>

四、发贴主要程序

{

Connection con=yy.getConn();

Statement stmt=con.createStatement();

if (Return_Id!="0")

{

sql="update 贴子 set 回复次数=回复次数+1 where 贴子id="+Return_Id;

stmt.executeUpdate(sql);

sql="update 论坛栏目 set 贴子数量=贴子数量+1,最后发表人='"+session.getValue("UserName")+"',最后发表时间='"+yy.getTime()+"' where 论坛id="+Board_Id;

stmt.executeUpdate(sql);

}else

{

sql="update 论坛栏目 set 贴子数量=贴子数量+1,最后发表人='"+session.getValue("UserName")+"',主题数量=主题数量+1 where 论坛id="+Board_Id;

stmt.executeUpdate(sql);

}

sql="update 用户表 set 发贴次数=发贴次数+1 where 用户名='"+session.getValue("UserName")+"'";

stmt.executeUpdate(sql);

sql="insert into 贴子(版块id,回复id,贴子名称,贴子内容,发表日期,贴子作者,贴子长度,显示签名,贴子图片,IP地址,回复用户,回复时间)";

sql=sql+"values("+Board_Id+","+Return_Id+",'"+Note_Title+"','"+Note_Content+"','"+yy.getTime()+"','"+session.getValue("UserName")+"',"+Note_Content.length()+","+Note_Singid+",'"+Note_Icon+"','"+request.getRemoteHost()+"','"+session.getValue("UserName")+"','"+yy.getTime()+"')";

//sql=sql+"values('"+Board_Id+"','"+Return_Id+"','"+Note_Title+"',"+Note_Content+","+yy.gettime()+",'lichao','"+Note_Content.length()+"','"+Note_Singid+"','"+Note_Icon+"','"+request.getRemoteHost()+"','lichao','"+yy.gettime+"')";

//out.println(sql);

stmt.executeUpdate(sql);

if (Return_Id=="0")

{

%>

<font size=2 color=blue>您的贴子发表成功,正在处理您的提交信息,稍后自动返回</font><meta http-equiv='refresh' content='2;url=board.jsp?fid=<%=Board_Id%>'>

<%

}else

{

%>

<font size=2 color=blue>您的贴子发表成功,正在处理您的提交信息,稍后自动返回</font><meta http-equiv='refresh' content='2;url=shownote.jsp?fid=<%=Board_Id%>&noteid=<%=Return_Id%>'>

五、回帖主要程序

<%

String Board_id=request.getParameter("fid");

String Note_id=request.getParameter("noteid");

String Return_id=request.getParameter("Returnid");

Connection con=yy.getConn();

Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

ResultSet rs=null;

if (Note_id!=null)

{

sql="Select 贴子内容 from 贴子 Where 贴子id="+Note_id;

rs=stmt.executeQuery(sql);

while (rs.next())

Note_Content=rs.getString("贴子内容");

}else

Note_Content="";

if (Note_id!=null)

Note_Content="[quote]"+Note_Content +"[/quote]";

if (Return_id!=null)

{

sql="Select 贴子名称 from 贴子 Where 贴子id="+Return_id;

rs=stmt.executeQuery(sql);

while (rs.next())

Note_Title="回复:"+rs.getString("贴子名称");

}else

Note_Title="";

sql="Select 论坛名称 From 论坛栏目 Where 论坛id="+Board_id;

//out.println(sql);

rs=stmt.executeQuery(sql);

while (rs.next())

Board_Name=rs.getString("论坛名称");

%>

6.2功能描述

论坛上的一些基本功能都要实现:用户注册、发贴、回帖、查看在线用户、给用户发邮件、后台管理等。

6.3性能描述

论坛最忌的就是数据量庞大,所以数据库要优化好,尽量减少冗余数据。还要考虑到安全性的问题,以保护会员安全。要能重复利用相同的模块,以减少系统开销。

1引言

软件测试分布在编码、测试和验收等几个阶段,是软件开发时期最繁重的任务,也是保证软件可靠性最主要的手段。

测试的目的是发现程序的错误,而不是证明程序是没有错误,设计测试用例和纠错,是搞好软件测试的两项关键技术。选择测试用例的目标,是用尽可能少的测试数据,达到尽可能大的程序覆盖面,发现尽可能多的软件错误和问题。

1.1编写目的

编写本测试计划是为了软件测试人员能够更好地、有的放矢地进行测试,尽可能地找出软件中的错误。

1.2背景

  1. 测试计划所从属的软件系统的名称:手机销售系统。
  2. 实现该软件的计算中心或计算机网络的能力一般即可,测试之前编码工作要完成,同时须配置好相应的运行环境以便系统能运行。

1.3定义

以下为本文件中用到的专门术语的定义:

手机销售系统 订单投诉

客户服务 新闻中心

我的订单 购物车

收银台 前台管理

后台管理 会员管理

手机销售论坛

1.4参考资料

1.《JSP编程实例集锦》 马文刚等编著 清华大学出版社

2.《数据库原理与技术》 刘方鑫编著 电子工业出版社

2计划

2.1软件说明

该系统主要分为四大模块:前台管理、后台管理、会员管理和手机销售论坛。具体的每个模块又可以实现以下的功能:前台管理要实现的有搜索引擎,销售排行,分类查看,公告,新闻,友情连接等功能;后台管理要实现的有商品管理、订单管理、用户管理、手机类别管理、信息管理、常规管理的添加,修改与删除的功能;会员管理要实现的是会员注册、订单查看、购物车、收银台、更改资料等的功能;手机销售论坛的功能是要包括一般论坛的功能,如发帖,回帖这些基本的功能。

2.2测试内容

系统完成以后,测试主要是看系统能否很好的完成预期的功能,以及异常处理做得怎么样,程序的可维护性和可扩展性如何。在这里测试主要采用的是黑盒测试。

以下给出四个模块的测试。

2.2.1前台管理测试

前台管理主要实现的功能包括搜索引擎、销售排行、分类查看、公告、新闻、友情链接等。对上述功能分别测试。

  1. 搜索引擎
    测试用例一:在搜索栏输入“诺基亚7710”,期望结果是显示一条“诺基亚7710”的记录,单击进入具体介绍“诺基亚7710”的页面。
    测试用例二:搜索栏输入为空,即直接单击“搜索”,期望结果是弹出“请输入搜索内容!”的页面。
    测试用例三:在搜索栏输入“诺基亚10”,期望结果是弹出“对不起,没有你要找的商品!”的页面。
  2. 对于销售排行、分类查看、公告和新闻的测试主要是看能否把数据库中的结果正确的显示到主页面上。
  3. 友情链接的测试是运行该系统,再点击相关链接,看能否转到相应的地址。

2.2.2后台管理的测试

后台管理主要实现的功能包括商品管理、订单管理、用户管理、手机类别管理、信息管理、常规管理等。对上述功能分别测试。

  1. 添加新商品
    测试用例一:对于要添加的属性项目,型号名称、市场价、会员价和VIP价填入如下内容(诺基亚10,1780,1650,1550),期望结果是弹出“添加成功!”的提示。
    测试用例二:对于要添加的属性项目,型号名称、市场价、会员价和VIP价填入如下内容( “ ”,1780,1650,1550),期望结果是弹出“请输入型号名称!”的提示,并返回到添加新商品的页面。
    测试用例三:对于要添加的属性项目,型号名称、市场价、会员价和VIP价填入如下内容(诺基亚10,1780,“ ”,1550),期望结果是弹出“请输入会员价!”的提示,并返回到添加新商品的页面。
    测试用例四:对于要添加的属性项目,型号名称、市场价、会员价和VIP价填入如下内容(诺基亚10,1780,1650,“ ”),期望结果是弹出“请输入VIP价!”的提示,并返回到添加新商品的页面。
  2. 查看与修改
    单击该项功能,会列出一系列手机的信息,如商品名称、会员价和VIP价,每条记录后都有两个功能删除和修改。以(诺基亚10,1650,1550)这条记录为例,点击“删除”,期望结果显示删除成功的提示;点击“修改”,把这条记录修改为(诺基亚10,1750,1550)确定后,显示修改成功的提示。
  3. 对于网站信息管理和网站常规设置主要是看前台的主页面能否正确的显示这些信息。
  4. 分类管理是把某类商品换个名称,如把“三星”,改为“SUMSUNG”。

2.2.3会员管理测试

会员管理主要实现的功能包括会员注册、订单查看、购物车、收银台、更改资料等。对上述功能分别测试。

  1. 会员注册
    测试用例一:对会员注册时要填的项目(用户名,密码,密码确认,E-mail,,地址,电话,邮编,真实姓名),填入下列内容(jiawei,845960,845960,[email protected],江苏徐州,3594884,221008,xujianhui),期望结果是提示注册成功。
    测试用例二:对会员注册时要填的项目(用户名,密码,密码确认,E-mail,,地址,电话,邮编,真实姓名),填入下列内容(jiawei,845962,845960,[email protected],江苏徐州,3594884,221008,xujianhui),期望结果是提示两次的密码必须一致。
    测试用例三:对会员注册时要填的项目(用户名,密码,密码确认,E-mail,,地址,电话,邮编,真实姓名),填入下列内容(jiawei,845960,845960,“ ”,江苏徐州,3594884,221008,xujianhui),期望结果是提示E-mail不能为空。
    会员注册时的这几个属性(用户名,密码,密码确认,E-mail,,地址,电话,邮编,真实姓名),设置的时候都不为空,少了任何一项都会出现少了该项的提示。
  2. 对于订单查看、购物车、收银台这些功能都是会员才有的功能,没有登陆之前,点击这些功能,会出现先登陆的提示,登陆后相应的操作可以验证相关的功能。
  3. 更改资料是对会员注册时填的项目(用户名,密码,密码确认,E-mail,,地址,电话,邮编,真实姓名)的修改。如把(jiawei,845960,845960,[email protected],江苏徐州,3594884,221008,xujianhui)这条记录修改为(jiawei,845960,845960,[email protected],江苏南通,3594884,221008,xujianhui),期望结果是出现修改成功的提示。

2.2.4手机销售论坛的测试

手机销售论坛有好几个版快,如三星,飞利浦等都有各自的论坛版快。这个模块的测试就是看能否在各自的论坛版快中发帖回帖,以及版主对帖子的修改和删除功能。

基于JSP的BBS实现

摘 要

现今的社会是一个信息飞速发达的社会,其中在信息的交流当中,互联网占据着一个非常重要的位置。人们可以通过在互联网上收到最新的消息,也可以通过互联网进行信息的交流。而论坛就是大家进行信息交流的其中一个渠道。

论坛的概念:论坛(BBS)是Bulletin-Board-System的缩写,即电子公告栏。它是一种在Internet网上开放的信息服务系统,通过论坛用户可以方便的实现信息的交换和文件的共享。

本文主要完成了基于JSP技术的信息交流论坛的设计和实现,主要实现了客户端和服务器端的动态交互。该系统包含六个模块:论坛用户登陆注册模块,论坛账户信息模块,论坛文章发布模块,公告/制度模块,版块管理模块,信息管理模块。论文详细描述了模块的结构、功能以及具体设计过程。系统采用了JSP技术以及JavaBeans组件技术和JDBC技术实现。

关键词:JSP,BBS,MYSQL,JavaBeans,系统设计

Bulletin-Board-System realization based on JSP

Abstract

Nowadays is a flourishing society that information travels fast. Among the exchanges of information, the Internet occupies a very important position, through which people can receive the latest news, and can exchange with each other as well. And the forum is an outlet for everyone to exchange information, which can also make the exchange of information convenient.

The concept of the forum: The forum (BBS) is the abbreviation of the Bulletin- Board- System, namely the column of the electronics announcement. It is a service system that is open on Internet, through which, the forum customer can conveniently realizes the commutation of the information and the share of the documents.

In this text, it mainly completed the design and realizations of information exchanges forum based on the JSP technique. And it main carry out a dynamic state between the customer and the server. There are six molds piece: The forum customer debarkation registers the mold piece, the forum bank account information mold piece, the forum article releases the mold piece, announce/ the system mold piece, a management mold piece, information management mold piece. The thesis has described module structure、function detailed and has designed process concretely. System has adopted the JSP technology and the JavaBeans module technology and the JDBC technology have come true.

KeyWord: JSP, BBS, MYSQL, JavaBeans, System design

目 录

摘 要I

AbstractII

绪 论1

第一章 系统概述2

1.1设计目标2

1.2 研究方法2

1.3项目中涉及的技术2

1.3.1 JSP技术2

1.3.2 JavaBeans技术3

1.3.3 JDBC技术3

1.4设备要求4

第二章 需求分析5

2.1需求规格5

2.1.1系统组成5

2.1.2功能性需求5

2.1.3非功能性需求7

2.2开发环境的选择7

第三章 概要设计8

3.1总体设计8

3.2系统结构与程序的关系10

3.3运行模式10

3.4接口设计10

3.4.1用户接口10

3.4.2外部接口10

3.4.3内部接口11

3.5数据结构设计11

3.5.1系统ER图11

3.5.2逻辑结构设计要点11

3.5.3物理结构设计要点13

3.5.4数据结构与程序的关系13

3.6功能模块设计16

3.6.1总体设计16

3.6.2功能模块设计16

3.7系统故障处理设计18

3.7.1出错信息18

3.7.2补救措施19

3.7.3系统维护设计19

第四章 详细设计20

4.1用户注册登陆模块20

4.1.1功能说明20

4.1.2功能实现20

4.1.3程序运行过程截图23

4.2帐户信息模块24

4.2.1功能说明24

4.2.2功能实现25

4.2.3程序运行过程截图28

4.3文章发布模块28

4.3.1功能说明28

4.3.2功能实现28

4.3.3程序运行过程截图29

4.4公告制度模块29

4.4.1功能说明29

4.4.2功能实现29

4.4.3程序运行过程截图31

4.5版块管理模块31

4.5.1功能说明31

4.5.2功能实现31

4.5.3程序运行过程截图33

4.6信息管理模块34

4.6.1功能说明34

4.6.2功能实现34

4.6.3程序运行过程截图36

第五章 结论37

参考文献(References)38

致谢39

绪 论

随着互联网日益深入社会生活,BBS开发技术发展至今,从CGI,ASP,到PHP已经日趋成熟,功能也更加丰富,但携着Sun公司的Java技术所实现的“一次编写,到处运行”的优势,继承这一衣钵的JSP技术越来越受到人们的注视。BBS作为一种对外的展示窗口,进行内外信息交流,已成为大众的广泛需要。为了进行更好的交流,用户想就自己的专业和爱好能和其他的用户进行及时专业的交流,这就有了论坛,这样以来我们就可以在网络这个虚拟的空间中方便地实现交流。Internet上发布信息主要是通过网站来实现的,获取信息是要在网站论坛中和Internet“海洋”中按照一定的检索方式将所需要的信息的。因此论坛建设在Internet应用上的地位显而易见,它已成为现代人勾通和获取信息的重要组成部分,从而倍受人们的重视。现在各个大学网站都有BBS论坛,在BBS上,同学与同学之间,老师之间可以非常轻松的进行交流,有网络的地方,不同的地区和国家的各种不同的人都可加入到BBS上进行交流。这也节省了大量的教育资源,和充分的利用教育资源。

Java是未来的主流开发技术,具有很多优势。JSP则是Java在Internet/Intranet Web上的重要应用技术,得到了广泛的支持和承认,它可以和各种Java技术完好地结合在一起,从而实现非常复杂的应用。本网站使用JSP + JavaBeans和后台数据库MYSQL在WEB系统开发的,从而创建一个更为稳定,高效,安全的运行环境。

本文主要讨论了基于B/S模式的一种JSP论坛的设计与实现,主要功能是实现客户端和服务器端的动态交互。其中有六个模块:论坛用户登陆注册模块,论坛帐户信息模块,论坛文章发布模块,公告/制度模块,版块管理模块,信息管理模块。实现论坛的基本功能,具体功能的实现利用JavaBeans组件技术。

第一章 系统概述

1.1设计目标

BBS是互联网一种人与人之间交互的必备工具,特别是做网站必备。以前我们一直用留言本形式,但是随着您的网站的大规模化,越来越多的迫切需要一种可以易于维护和易于交流的平台,那就要用BBS。BBS可以通过WEB浏览器访问,并且实现在线交流等诸多功能。网民们便逐步开始接受这种使用方便快捷、功能日渐强大的系统。在它上面网民们可以发贴和发布各种各样的信息,讨论各式话题。随着中国网络的普及和计算机及其外设的大幅度降价,Internet这个概念逐渐深入人心。中国网民的数量呈几何级数量增长,BBS的普及程度也直追Email。每个网站几乎都拥有自己的BBS或者BBS链接, BBS社区提供给用户的服务是全面而且非常友好的,用户在社区中可以根据自己的喜好设置不同的显示风格,根据自己的需求定制各种服务。

1.2 研究方法

本虚拟社区是采用JSP + JavaBeans + MYSQL开发的。运行平台:JDK 1.5 + Tomcat5.5 + MYSQL + Windows XP。

采用模块化思想,分为3层:

a.数据存储层:使用MYSQL来存放BBS的所有数据,包括用户信息,文章数据用户消息,系统数据,关键问题,数据库的规划。

b. 系统功能层:完成BBS的基本功能,由多个并列模块组成,向下调用MYSQL的数访问数据库,向上接受处理请求,将处理的结果返回上层,根据请求类型,返回成败结果和其他数据。而且模块高度灵活,可以方便的修改增加。

c. 服务层:直接和客户机对话,根据客户机的请求,调用功能模块取得数据,然后将数据发送回客户端,根据客户端的类型,分别开发不同的服务模块,并且尽可能合理进行抽象,使对不同的服务层,能共用系统功能层的模块。

1.3项目中涉及的技术

1.3.1 JSP技术

JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。 JSP技术是用JAVA语言作为脚本语言的,JSP网页为整个服务器端的JAVA库单元提供了一个接口来服务于HTTP的应用程序。

在传统的网页HTML文件(*.htm,*.html)中加入Java程序片段(Scriptlet)和JSP标记(tag),就构成了JSP网页(*.jsp)。Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序片段,然后将执行结果以HTML格式返回给客户。程序片段可以操作数据库、重新定向网页以及发送 email 等等,这就是建立动态网站所需要的功能。所有程序操作都在服务器端执行,网络上传送给客户端的仅是得到的结果,对客户浏览器的要求最低,可以实现无Plugin,无ActiveX,无Java Applet,甚至无Frame。

1.3.2 JavaBeans技术

什么是JavaBeans?JavaBeans就是Java的可重用组件技术。最初,JavaBeans的目的是为了将可以重复使用的软件代码打包标准。特别是用与帮助厂家开发在综合开发环境(IDE)下使用的java软件部件。这些包括如Grid控件,用户可以将该部件拖放到开发环境中。从此,JavaBeans就可以扩展为一个java web 应用的标准部件,并且JavaBeans部件框架已经扩展为企业版的 Bean(EJB)。JavaBeans是描述JAVA的软件组件模型,有点类似于Microsoft的COM组件概念。在JAVA模型中,通过JavaBeans可以无限扩充JAVA程序的功能,通过JavaBeans的组合可以快速的生成新的应用程序。对于程序员来说,最好的一点就是JavaBeans可以实现代码的重复利用,另外对于程序的易维护性等等也有很重大的意义。ASP通过COM来扩充复杂的功能,如文件上载、发送email以及将业务处理或复杂计算分离出来成为独立可重复利用的模块。JSP通过JavaBeans实现了同样的功能扩充。JSP对于在Web应用中集成JavaBeans组件提供了完善的支持。这种支持不仅能缩短开发时间(可以直接利用经测试和可信任的已有组件,避免了重复开发),也为JSP应用带来了更多的可伸缩性。JavaBeans组件可以用来执行复杂的计算任务,或负责与数据库的交互以及数据提取等。在实际的JSP开发过程中,读者将会发现,和传统的ASP或PHP页面相比,JSP页面将会是非常简洁的,由于JavaBeans开发起来简单,又可以利用Java语言的强大功能,许多动态页面处理过程实际上被封装到了JavaBeans中。

1.3.3 JDBC技术

JDBC是一种可用于执行SQL语句的Java API(Application Programming Interface,应用程序设计接口)。它由一些Java语言写的类、界面组成。JDBC给数据库应用开发人员、数据库前台工具开发人员提供了一种标准的应用程序设计接口,使开发人员可以用纯Java语言编写完整的数据库应用程序。

Java 具有坚固、安全、易于使用、易于理解和从网络上自动下载等特性,是编写数据库应用程序的杰出语言。所需要的只是 Java 应用程序与各种不同数据库之间进行对话的方法。而 JDBC 正是作为此种用途的机制。

通过使用JDBC,开发人员可以很方便地将SQL语句传送给几乎任何一种数据库。也就是说,开发人员可以不必写一个程序访问Sybase,写另一个程序访问Oracle,再写一个程序访问Microsoft的SQL Server。用JDBC写的程序能够自动地将SQL语句传送给相应的数据库管理系统(DBMS)。不但如此,使用Java编写的应用程序可以在任何支持Java的平台上运行,不必在不同的平台上编写不同的应用。Java和JDBC的结合可以让开发人员在开发数据库应用时真正实现“Write Once,Run Everywhere!”

JDBC 扩展了 Java 的功能。例如,用 Java 和 JDBC API 可以发布含有 applet的网页,而该 applet 使用的信息可能来自远程数据库。企业也可以用 JDBC 通过Intranet 将所有职员连到一个或多个内部数据库中(即使这些职员所用的计算机有 Windows、 Macintosh 和 UNIX 等各种不同的操作系统)。随着越来越多的程序员开始使用 Java 编程语言,对从 Java中便捷地访问数据库的要求也在日益增加。

1.4设备要求

主机类型:

服务器(IBM兼容机)最低配置

CPU:P3-850MHz;

内存:256MB

硬盘:20GB

网卡:10/100MB自适应

客户机(IBM兼容机)最低配置

CPU:P3-450MHz;

内存:128MB

硬盘:10GB

网卡:10/100MB自适应

第二章 需求分析

2.1需求规格

2.1.1系统组成

系统可以分为以下几个功能模块:

  1. 论坛用户登陆注册模块:包括用户登陆,退出,注册等功能。
  2. 论坛帐户信息模块:当用户登陆系统后,在个人中心,可以通过修改个人资料的链接来修改个人资料(其中用户ID是不允许修改的),通过我的话题来查看和修改自己发布的文章。
    3.论坛文章发布模块:用户登陆系统后可以查看其他所有用户发的文章,并可以发布自己的话题,也可响应回复其他用户和自己发表的话题。
    4.公告/制度模块:论坛管理员可以通过后台管理系统发布论坛公告,今日话题等功能,论坛的制度上可以设置对文章操作的得分,发帖数,精华帖。
    5. 版块管理模块:论坛管理员可以通过后台管理系统控制论坛的版块,管理员可以完成下列功能:任命斑竹,修改版块等操作。
    6.信息管理模块。社区信息配置;添加管理员; 编辑管理员;设定等级;配置权限;重新登录;安全退出;用户等级。
    以上的功能完成了整个论坛的配置,用户的管理,管理员的管理都可以通过对应的链接来完成。
    以下是该BBS系统软件的功能模块图:
    BBS软件系统

    注册登陆
    帐户信息
    文章发布
    公告制度
    版块管理
    信息管理
    图2.1 BBS系统软件的功能模块图
    2.1.2功能性需求
    1.用户注册登陆模块
    表2-1 用户注册登陆模块
模块名称:用户注册登陆 模块标识:A1
其中可能涉及到的操作有以下几种: 用户登录:管理员及用户可以根据用户名及密码登陆系统。 用户注册:用户可以独立注册论坛帐户。修改数据:管理员可以修正错误数据,比如用户信息等。用户退出:用户退出时,变成游客权限,只能浏览帖子。

2. 帐户信息模块
表2-2 帐户信息模块

模块名称:帐户信息 模块标识:A2
该模块主要在个人中心中,对用户信息及发表文章进行操作。其中可能涉及到的操作有以下几种:添加,删除,修改个人信息。查看,修改或删除本用户发表过的文章消息。更换照片,修改签名,预览签名。
  1. 文章发布模块

表2-3 文章发布模块

模块名称:文章发布 模块标识:A3
该模块主要完成整个BBS系统面向用户的各种功能。其中可能涉及到的操作有以下几种:1 发布论坛话题:用户可以通过此功能发布论坛话题,也就是常说的发帖。2 回复话题:用户可以回复任何已存在的话题,同时可以加上自己的个性签名。

4、公告/制度模块

表2-4 公告/制度模块

模块名称:公告/制度 模块标识:A4
论坛管理员(站长)可以通过后台管理任命斑竹,拥有最高权限。斑竹只能在自己的版块发布论坛公告,最新话题,可以对帖子置顶,删除,锁定等操作。

5.版块管理模块

表2-5 版块管理模块

模块名称:版块管理模块 模块标识:A5
论坛管理员可以通过后台管理系统控制论坛的版块,管理员可以完成下列功能:任命斑竹,修改版块等操作。

6. 信息管理模块

表2-6 信息管理模块

模块名称:信息管理 模块标识:A6
信息管理模块主要完成下面的功能:社区信息配置;添加管理员; 编辑管理员;设定等级;改变权限;会员管理;安全退出;用户等级。

2.1.3非功能性需求

本系统界面友好,使用方便,运行稳定。是一种典型的BBS系统。

2.2开发环境的选择

系统需求分析阶段: Microsoft Windows XP

系统代码开发阶段:Windows XP+ JDK1.5 + tomcat5.5 +MYSQL。

系统GUI/LOGO辅助设计工具:Photoshop8.0,Dreamware8.0。

第三章 概要设计

3.1总体设计

我们采用基于B/S结构的三层应用模型来实现BBS系统。Browser/Server计算方式是一种两层结构的体系。随着技术的进步以及需求的改变,更多的层次划分出来。目前,在Internet应用体系结构中,事物处理被划分为3层,即:Web Browser—Internet Server—Database Server。在这种体系结构中,业务的表达通过简单的Web Browser来实现,用户通过Web Browser提交表单,把信息传递给Internet Server,Internet Server根据用户的请求,分析出要求数据库服务器进行的查询,交给数据库服务器去执行,Database Server把查询的结果反馈给Internet Server,在由Internet Server用标准的HTML语言反馈给Web Browser。

三层应用模型同传统的C/S(Client/Server)模型相比,提高了系统的可扩展性、安全性和可重用性。它将应用逻辑与用户界面和数据访问相剥离,这样便使系统的维护变得简单,同时可以通过采用组件技术,降低数据库服务器的负担,从而提高性能。

典型C/S计算的特点:

  1. 服务器负责数据管理及程序处理;
  2. 客户机负责界面描述和截面显示;
  3. 客户机向服务器提出处理要求;
  4. 服务器响应后将处理结果返回客户机;
  5. 网络数据传输小。
    经过分析,B/S结构适合本系统,它具有以下优点:
    1. B/S技术所基于的标准是开放、非专有的,是经标准化组织指定而非单一厂商制定的。
    2. B/S技术成本较低,一般只需安装、配备还在服务器上。在客户机上的工作较少,故降。

低了开发及管理成本。而C/S的应用不论是安装、配备还是升级,都需要在所有的客户机上实施。

B/S技术维护工作主要集中在服务器端,客户端的维护工作量十分少。而C/S结构中客户机和服务器的维护工作量都较大。Web Browser技术简明易用,一旦用户掌握了Web Browser的用法,也就掌握了使用系统上各种信息资源的钥匙。

本虚拟社区是采用JSP + JavaBean + MYSQL开发的一套网络虚拟社区系统。通过BBS系统和别人讨论计算机软件、硬件、Internet、多媒体、以及程序设计等等各种有趣的话题。

图3.1 网络结构图

图3.2 系统结构图

3.2系统结构与程序的关系

3-1 各项功能需求模块的实现同各块程序的分配关系

3.3运行模式

功能模块 相关程序
注册登陆 reg.jsp;login.jsp;online.jsp;shutdown.jsp;pcmain.jsp
帐户信息 first.jsp;modify.jsp;repassword.jsp;modifype.jsp;showpenname
文章发布 send.jsp;reply.jsp;display.jsp
公告制度 actboardset.jsp;inform.jsp
版块管理 adminmast.jsp;changeroot.jsp;addmast.jsp
信息管理 madmin.jsp;mdel.jsp;medit.jsp;msend.jsp;mshow.jsp

图3.3 本系统的各个模块的运行顺序

3.4接口设计

3.4.1用户接口

本系统采用的标准的HTML编写,内部套用JavaScript、CSS,风格统一,用户可通过一个窗体即可完成所有的输入工作,本模块不涉及大图片、音频和视频等,这样能保证输出时的快速性。用户可以直观的查看数据和填写数据,尽可能的简化操作,其主界面简便易于使用。

3.4.2外部接口

系统的数据库连接主要采用JDBC的方式,这样的连接方法简单,避免了过多的配置,数据库的访问全部由操作系统内部来完成。数据库的接口采用JavaBean连接实现。使用MYSQL来存放BBS的所有数据,包括用户信息,文章数据,用户消息,系统数据等。

3.4.3内部接口

JavaBean完成Jsp程序和数据库的连接;方便对数据库的读写,提高重用度,减少代码量。

3.5数据结构设计

3.5.1系统ER图

根据UML系统模型,可以确定系统中的各种实体以及它们之间的关系。本系统的实体包括管理员数据实体(Numb1)、用户数据实体(User)、帖子数据实体(btable)等。

M

浏览

浏览

帖 子

用户

1

M

管理

管理

N

管理员

1

1

图3.4 系统ER图

3.5.2逻辑结构设计要点

数据库表结构

1.Board表

3-2 Board表

字 段 类 型 长 度 允 许 空
Id Int 11
Btable varchar 20
Name Varchar 30
Logo Varchar 100 yes
Inform Varchar 160 yes
Focus Varchar 200 yes
Boardmast Varchar 255

2. Numb1表

3-3 Numb1表

字 段 类 型 长 度 允 许 空
Userid Varchar 20
Pw Varchar 20
Mail Varchar 40 yes
Tim Datetime

3. Onlcount表

3-4 Onlcount表

字 段 类 型 长 度 允 许 空
Id Int 11
Page Varchar 80
Time Varchar 10
Userid Varchar 20
Username Varchar 20
Ip Varchar 15

4.Online表

3-5 Online表

字 段 类 型 长 度 允 许 空
Userid Varchar 20
Ontims Int 11 yes
Txt Int 11 yes
Point Int 10 yes
Penname1 Varchar 250 yes
Penname2 Varchar 250 yes

5.btable表

3-6 btable表

字 段 类 型 长 度 允 许 空
Id Int 11
super Int 11
Boardid Int 11
title Varchar 40
Txt Text
Userid Varchar 20
Username Varchar 20
Time Datetime
ip Datetime
editime Varchar 250 yes

6.User表

3-7 User表

字 段 类 型 长 度 允 许 空
userid Varchar 20
Step Int 11
Root Varchar 75
Question Varchar 30 yes
Answer Varchar 30 yes
Face Varchar 50
Name Varchar 20
Sex Varchar 5 yes
Mail Varchar 5 yes
Qq Varchar 15 yes
Tel Varchar 15 yes
Job Varchar 20 yes

3.5.3物理结构设计要点

系统数据库采用MYSQL。今天的商业环境要求不同类型的数据库解决方案。性能、可伸缩性及可靠性是基本要求,MYSQL 给数据管理与分析带来了灵活性。从数据管理和分析角度看,MYSQL可以作为一个完备的数据库和数据分析包。作为重要的基准测试可伸缩性和速度奖的记录保持者,MYSQL 是一个具备完全功能支持的数据库产品,提供了对可扩展标记语言 (XML) 的核心支持以及在 Internet 上和防火墙外进行查询的能力。

3.5.4数据结构与程序的关系

服务器端程序采用JDBC来访问数据库:

----------------------------------------------------------------------------------------------------------------

Class.forName("com.mysql.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://"+"localhost"+"/"+numb1,"root","");

----------------------------------------------------------------------------------------------------------------

上面两条Java语句完成数据库的连接,而下面几条语句则完成最基本的信息数据查询操作。

----------------------------------------------------------------------------------------------------------------

package numb1.com;

import java.lang.*;

import java.sql.*;

public class db{

private Connection con;

private Statement st;

private ResultSet rs;

private String host="localhost";

private String user="root";

private String pw="";

private String db="numb1";

private String Dri="com.mysql.jdbc.Driver";

private String url="jdbc:mysql://"+host+"/"+db;

public String getStr(String s){

String str=s;

try{

byte b[]=str.getBytes("ISO-8859-1");

str=new String(b);

return str;

}

catch(Exception e){return null;}

}

public String gb2iso(String qs){

try{

if (qs == null) return "NULL";

else return new String(qs.getBytes("gb2312"),"iso-8859-1");

}

catch(Exception e){

System.out.print("gb2iso error:"+e.getMessage());

}

return "NULL";

}

public void close(){//关闭连接

try{

if(rs!=null)rs.close();

}catch(Exception e){

System.out.print("rs"+e.getMessage());

}

try{

if(st!=null)st.close();

}catch(Exception e){

System.out.print("st"+e.getMessage());

}

try{

if(con!=null)con.close();

}catch(Exception e){

System.out.print("con"+e.getMessage());

}

}

public ResultSet query(String sql)throws Exception{

try{

Class.forName(Dri).newInstance();

con=DriverManager.getConnection(url,user,pw);

st=con.createStatement();

rs=st.executeQuery(sql);

return rs;

}catch(SQLException e){

System.out.print(e.getMessage());

return null;

}

}

public void update(String sql)throws Exception{

try{

Class.forName(Dri).newInstance();

con=DriverManager.getConnection(url,user,pw);

st=con.createStatement();

st.executeUpdate(sql);

st.close();

con.close();

}catch(SQLException e){

System.out.print(e.getMessage());

}

}

}

通过上面的Java语句,服务器端就完成了对数据库的连接,并且实现了对数据库的查询、更新等操作。

---------------------------------------------------------------------------

3.6功能模块设计

3.6.1总体设计

BBS系统总体上分6个模块,模块之间相互连接,互相作用,从用户的注册,登陆退出到发表文章,回复文章,对BBS系统的管理都可以通过简单的操作来完成。论坛系统设计简洁明了,没有过多的附属功能。

3.6.2功能模块设计

  1. 用户注册登陆模块

要完成论坛的各项操作,用户必须登陆论坛系统,如果没有论坛帐户,用户注册是必须的。用户命令如果是退出,则清除用户的状态信息,并返回BBS 首页,如果是登录则使用JDBC连接数据库,取得用户输入的帐号和密码并查询数据库,将得出的结果和用户输入的信息做比较,验证正确,显示用户已经登陆到系统,错误将返回消息让用户从新输入。如果用户想注册帐户,则返回注册页面,用户填写信息后,将检测信息的正确性,如果帐号允许注册,则完成帐号的注册,将信息写入到数据库中,如果帐户已经存在,则返回错误信息,告诉用户帐号存在,请用户从新输入,并完成注册,进程结束。

图3.5 用户注册登陆模块

(2)帐户信息模块

当用户登陆系统后,在个人中心中,可以通过修改资料的链接来修改个人资料(其中帐户名是不允许修改的),通过我的话题来查看和修改自己发布的文章。

图3.6 帐户信息模块

(3) 文章发布模块

用户登陆系统后可以查看其他所有用户发的文章,并可以发布自己的话题,也可响应回复其他用户和自己发表的话题。

图3.7 文章发布模块

(4) 公告制度模块

论坛管理员可以通过后台管理系统发布论坛公告,今日话题,并可以设置版面图标。

(5) 版块管理模块

论坛管理员可以通过后台管理系统控制论坛的版块,管理员可以完成下列功能:添加分类或版面,版面配置或删除;并可以对已存在的版块设置属性。

(6) 信息管理模块

信息管理模块主要完成下面的功能。信息配置;添加管理员; 编辑管理员;设定等级;配置权限;重新登录;安全退出;用户等级;用户列表。

以上的功能完成了整个论坛的配置,用户的管理,管理员的管理都可以通过对应的链接来完成。

3.7系统故障处理设计

3.7.1出错信息

3-8出错或故障情况一览表

错误类型 错误代号 异常类型 输出信息 处理方法
1 用户帐号不存在 ERR_01 NULL 无此帐号 请用户注册
2 用户密码错误 ERR_02 Check Error 密码错误 重新输入
3 数据库连接错误 ERR_03 Connect 无法连接数据库 告诉用户错误。
4 数据库查询错误 ERR_04 Select 查询数据库出错 请客户稍后重试
5 数据库查询错误 ERR_04 Insert(创建帐号) 无法创建帐户 请客户稍后重试
6 数据库查询错误 ERR_04 Delete(删除好友) 无法删除好友 请客户稍后重试
7 数据库查询错误 ERR_04 Updata(更新数据) 无法更新数据库 请客户稍后重试
8 用户没有权限 ERR_05 Permissions(权限) 用户没有权限 告知用户

3.7.2补救措施

当出现帐号,密码等通常的错误时,用户可以重新输入信息,即可解决,或是重新启动客户端,当出现无法连接数据库或者是查询中的错误,通常系统管理员重新启动服务即可解决,由于数据库的连接错误是全局的,所以重新启动服务是最佳的操作。

3.7.3系统维护设计

用于系统的检查与维护的检测点和专用模块,在这个版本中没有出,将会在后续开发中增加,例如自动重新启动服务,自动纠正数据的错误。以及用户数据的安装问题,密码的加密问题。

第四章 详细设计

4.1用户注册登陆模块

4.1.1功能说明

要完成论坛的各项操作,用户必须登陆论坛系统,如果没有论坛帐户,用户注册是必须的。用户命令如果是退出,则清除用户的状态信息,并返回BBS 首页,如果是登录则使用JDBC连接数据库,取得用户输入的帐号和密码并查询数据库,将得出的结果和用户输入的信息做比较,验证正确,显示用户已经登陆到系统,错误将返回消息让用户从新输入。如果用户想注册帐户,则返回注册页面,用户填写信息后,将检测信息的正确性,如果帐号允许注册,则完成帐号的注册,将信息写如到数据库中,如果帐户已经存在,则返回错误信息,告诉用户帐号存在,请用户从新输入,并完成注册,进程结束。

4.1.2功能实现

----------------------------------------------------------------------------------------------------------------

登陆页面:login.jsp

部分代码:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<jsp:useBean id="con" scope="page" class="numb1.com.db"/>

<jsp:useBean id="ht" scope="page" class="numb1.com.Dohtml"/>

<jsp:useBean id="onLine" scope="application" class="numb1.com.onLine"/>

<%@ include file = "include/config.jsp" %>

<%

String p=request.getParameter("page");p=ht.donull(p);

String bdid=request.getParameter("bdid");bdid=ht.donull(bdid);

String bbsid=request.getParameter("bbsid");bbsid=ht.donull(bbsid);

String name="";

String root="";

String sendredir="first.jsp";

String sql;

ResultSet rs;

if(p.indexOf("display")!=-1){

sendredir=p+".jsp?bdid="+bdid+"&bbsid="+bbsid;

}else if(p.indexOf("main")!=-1){

sendredir=p+".jsp?id="+bdid;

}

%>

<%

String id=(String)request.getParameter("id");id=ht.donull(id);

String mm=(String)request.getParameter("pw");mm=ht.donull(mm);

boolean test;

if(id.compareTo("")!=0 && mm.compareTo("")!=0){

if(online_enable == "on"){

test=onLine.Login(id,request.getRemoteAddr());

}else{

test=true;

}

if(test){

sql="select*from numb1 where userid='"+id+"' and pw='"+mm+"'";

rs=con.query(sql);rs.next();if(rs.getRow()!=0){

session.setAttribute("id",id);

sql="select step, name from user where userid='"+id+"'";

rs=con.query(sql);rs.next();

if(rs.getRow()!=0){

root=rs.getString(1);

name=con.getStr(rs.getString(2));

session.setAttribute("root",root);

session.setAttribute("name",name);

}

sql="select ontims from online where userid='"+id+"'";

rs=con.query(sql);rs.next();

int count=rs.getInt(1)+1;

String ip=request.getRemoteAddr();

sql="update online set ontims="+count+",lastip='"+ip+"',lastim=now() where userid='"+id+"'";

con.update(sql);

response.sendRedirect(sendredir);

上面代码实现用户登陆界面,对用户信息进行验证,如果用户名和密码没有错误,则进入论坛系统,可以拥有注册用户所有的权限。否则提示错误信息。

----------------------------------------------------------------------------------------------------------------

注册页面reg.jsp

部分代码:

<script language="JavaScript" type="text/JavaScript">

function check_form(theform)

{

if (theform.id.value.length<4)

{

alert("对不起,您的ID长度不够!");

theform.id.focus();

return false;

}

if (theform.mm1.value.length<4)

{

alert("对不起,您的密码长度不够!");

theform.id.focus();

return false;

}

if (theform.mm1.value==""||theform.mm2.value==""||theform.mm1.value!=theform.mm2.value)

{

alert("您输入密码的方式不正确,请确认后正确输入!");

theform.mm1.focus();

return false;

}

if (theform.mail.value=="")

{

alert("请输入您的E-mail,以便您的密码遗失后取回密码!");

theform.mail.focus();

return false;

}

if (theform.mail.value.indexOf('@') == -1||

theform.mail.value.indexOf('.') == -1||

theform.mail.value.charAt(0)==".")

{

alert("Email地址格式不正确!");

theform.mail.focus();

return false;

}//value

if (theform.name.value=="")

{

alert("请输入您的昵称!");

theform.name.focus();

return false;

}

}

function KeyFilter(){

if (!((event.keyCode>96 && event.keyCode<123)||(event.keyCode>47 && event.keyCode<58)||(event.keyCode=95)))

return false;

}

</script>

上面代码实现对用户信息的验证,提示新用户需要注意的问题,那些选项是必须填写的,那些是可选的,并过滤一些非法字符,使注册功能更完善。

----------------------------------------------------------------------------------------------------------------

4.1.3程序运行过程截图

用户登陆页面login.jsp

图4.1 用户登陆页面

用户注册页面reg.jsp

图4.2 用户注册页面

4.2帐户信息模块

4.2.1功能说明

当用户登陆系统后,在个人中心,可以通过修改资料的链接来修改个人资料(其中帐户名是不允许修改的),通过我的主题来查看和修改自己发布的文章。

4.2.2功能实现

----------------------------------------------------------------------------------------------------------------

主题显示:pcmain.jsp

部分代码:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<jsp:useBean id="con" scope="page" class="numb1.com.db"/>

<jsp:useBean id="ht" scope="page" class="numb1.com.Dohtml"/>

<jsp:useBean id="onLine" scope="application" class="numb1.com.onLine"/>

<%@ include file = "include/config.jsp" %>

<%

String id=(String)session.getAttribute("id");id=ht.donull(id);

String root=(String)session.getAttribute("root");root=ht.donull(root);

String name=(String)session.getAttribute("name");name=ht.donull(name);

String bdid=request.getParameter("id");

String stringpage=request.getParameter("page");//stringpage为未处理的字符串型的页码数

String table="";

String bdname="";

String logo="";

String information="";

String focus="";

String main="main.jsp";

String display="display.jsp";

String reer="";

String sql;

int retimes,readtimes;

int x=0;//计数器

int count=0;

int showrow=36;//每页显示条数

int pages=1;//当前页数

int startrow; //本页开始条数

int allcount=0;

//本页文件名

String f_name=request.getRequestURI().substring(request.getRequestURI().lastIndexOf("/")+1,request.getRequestURI().lastIndexOf("."));

if(root.compareTo("")==0){root="0";}

int step=Integer.parseInt(root);

pages=ht.getInteger(stringpage,1);

if(!ht.isNumber(bdid)){

out.print("<meta http-equiv=\"refresh\" content=\"1;URL=first.jsp\"><center><font color=#FF0000><strong>参数错误</strong></font></center>");

}else{

sql = "SELECT btable, name, logo, inform, focus, page FROM board WHERE id="+bdid;

ResultSet board=con.query(sql);board.next();

if(board.getRow()==0){

out.print("<meta http-equiv=\"refresh\" content=\"1;URL=index.jsp\"><center><font color=#FF0000><strong>该版不存在,参数错误或该版以被删除</strong></font></center>");

}else{

table=board.getString(1);

bdname=con.getStr(board.getString(2));

logo=con.getStr(board.getString(3));

information=con.getStr(board.getString(4));

focus=con.getStr(board.getString(5));

main=board.getString(6)+main;

display=board.getString(6)+display;

java.io.File f1=new java.io.File(absDir+relDir+main);

java.io.File f2=new java.io.File(absDir+relDir+display);

if(!f1.isFile()){main="main.jsp";}

if(!f2.isFile()){display="display.jsp";}

//验证页面

if((main.compareTo(_self)!=0)){

response.sendRedirect(main+"?id="+bdid);

}else{

//计算本版总贴数

if(table.compareTo("")==0){table="btable1";}

sql="SELECT COUNT(id) FROM "+table+" WHERE boardid="+bdid;

ResultSet bcount=con.query(sql);bcount.next();

if(bcount.getRow()!=0){

allcount=bcount.getInt(1);

}

//计算页数

sql="SELECT id, title, clas, super, recommendation, locked, userid, username, lastid, lastname, readtimes, retimes, lastretime FROM "+table+" WHERE boardid="+bdid+" AND up='n' ORDER BY lastretime DESC" ;

ResultSet rs=con.query(sql);

rs.last();

count=rs.getRow();

int pcount=count/showrow;

if(count%showrow>0){pcount=pcount+1;}

if(pcount<2)pcount=1;

if(pages<2)pages=1;

if(pages>pcount)pages=pcount;

startrow=(pages-1)*showrow+1;

if(online_enable == "on"){

String uId,uName,ip=request.getRemoteAddr();

if(id.compareTo("")==0){

uId="guest";

uName="guest";

}else{

uId=id;

uName=name;

}

onLine.addUser(uId,uName,(_self+"?id="+bdid),ip,onTime);

}

%>

本页面实现对文章的分页显示功能,验证页面,对各个版块的主题进行显示和处理,可以提高用户的浏览速度,结构更整洁。

----------------------------------------------------------------------------------------------------------------

4.2.3程序运行过程截图

主题显示:pcmain.jsp

图4.3 主题显示

4.3文章发布模块

4.3.1功能说明

用户登陆系统后可以查看其他所有用户发的文章,并可以发布自己的话题,也可响应回复其他用户和自己发表的话题。

4.3.2功能实现

----------------------------------------------------------------------------------------------------------------

文章发表:send.jsp

部分代码:

<%

String bdid=request.getParameter("id");

String id=(String)session.getAttribute("id");

String bdname="";

String main="main.jsp";

if(id==null){response.sendRedirect("login.jsp");}else{

String sql="select name, page from board where id="+bdid;

ResultSet rs=con.query(sql);rs.next();

if(rs.getRow()!=0){

bdname=con.getStr(rs.getString(1));

main=rs.getString(2)+main;

}

con.close();

%>

本页面提供用户的发帖功能,用户可以根据自己的需要发表帖子,可以选择自己的类型,比如普通,原创,转帖等类型,有签名功能,还可以使用多彩文本,给用户提供更完美的选择。

---------------------------------------------------------------------------------------------------------------

4.3.3程序运行过程截图

文章发表:send.jsp

图4.4 文章发表

4.4公告制度模块

4.4.1功能说明

论坛管理员可以通过后台管理系统发布论坛公告,今日话题。

论坛的制度上可以设置对文章操作的客户积分,发帖数,精华帖等功能。

4.4.2功能实现

公告信息:boardset.jsp

部分代码:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<jsp:useBean id="con" scope="page" class="numb1.com.db"/>

<jsp:useBean id="ht" scope="page" class="numb1.com.Dohtml"/>

<%

String id=(String)session.getAttribute("id");id=ht.donull(id);

String root=(String)session.getAttribute("root");root=ht.donull(root);

String bdid=request.getParameter("bdid");

String table="";

String logo="";

String bdname="";

String inform="";

String focus="";

String bdmast="";

boolean test=false;

if(root.compareTo("")==0){root="0";}

int step=Integer.parseInt(root);

String sql="select btable,name,logo,inform,focus,boardmast from board where id="+bdid;

ResultSet rs=con.query(sql);rs.next();

if(rs.getRow()!=0){

table=rs.getString(1);

bdname=con.getStr(rs.getString(2));

logo=rs.getString(3);

inform=con.getStr(rs.getString(4));

focus=con.getStr(rs.getString(5));

bdmast=con.getStr(rs.getString(6));

String mast[]=ht.split(bdmast,"*");

for(int i=0;i<mast.length-1;i+=2){

if(mast[i].compareTo(id)==0){

test=true;

}

}

}con.close();

if(step>2 || test){

%>

本页面是给管理员提供了对版块更好的管理,可以通过发布公告给本论坛的用户最新的通知,还有发表今日话题,能更快的对论坛进行有效的管理。

---------------------------------------------------------------------------------------------------------------

4.4.3程序运行过程截图

公告信息:boardset.jsp

图4.5 公告信息

4.5版块管理模块

4.5.1功能说明

论坛管理员可以通过后台管理系统开控制论坛的版块,管理员可以完成下列功能:添加分类或版面,版面配置或删除.

4.5.2功能实现

--------------------------------------------------------------------------------------------------------------

权限列表:rootlist.jsp

部分代码:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<jsp:useBean id="con" scope="page" class="numb1.com.db"/>

<jsp:useBean id="ht" scope="page" class="numb1.com.Dohtml"/>

<%

String root=(String)session.getAttribute("root");root=ht.donull(root);

String user_id=request.getParameter("id");user_id=ht.donull(user_id);

String user_name="";

String user_ontimes="";

String user_txts="";

String user_retxts="";

String user_point="";

String user_popu="";

String user_sup="";

String user_recom="";

String duty="";

int user_step=0;

boolean test=true;

if(root.compareTo("")==0){root="0";}

int step=Integer.parseInt(root);

if(step<4){

out.print("<meta http-equiv=\"refresh\" content=\"3;URL=../index.jsp\"><center><font color=#FF0000><strong>对不起,您无权进入该页面!</strong></font></center>");

}else{

String user="select step,root,name from user where userid='"+user_id+"'";

ResultSet use_rs=con.query(user);use_rs.next();

if(use_rs.getRow()==0){

test=false;

}else{

user_step=use_rs.getInt(1);

String user_root[]=ht.split(con.getStr(ht.donull(use_rs.getString(2))),"*");

if(user_root.length>1) duty="<a href=../main.jsp?id="+user_root[0]+">"+user_root[1]+"</a>";

user_name=con.getStr(use_rs.getString(3));

}

con.close();

String online="select ontims,txt,re,point,popu,suptxt,recomtxt from online where userid='"+user_id+"'";

ResultSet onl_rs=con.query(online);onl_rs.next();

if(onl_rs.getRow()==0){

test=false;

}else{

user_ontimes=onl_rs.getString(1);

user_txts=onl_rs.getString(2);

user_retxts=onl_rs.getString(3);

user_point=onl_rs.getString(4);

user_popu=onl_rs.getString(5);

user_sup=onl_rs.getString(6);

user_recom=onl_rs.getString(7);

}

con.close();

if(!test){

out.print("<meta http-equiv=\"refresh\" content=\"2;URL=../index.jsp\"><center><font color=#FF0000><strong>该会员不存在!</strong></font></center>");

}else{

%>

论坛管理员可以通过后台管理系统控制论坛的版块,管理员可以完成下列功能:任命斑竹,取消斑竹,改变权限等功能。

---------------------------------------------------------------------------------------------------------------

4.5.3程序运行过程截图

权限列表:rootlist.jsp

图4.6 权限列表

4.6信息管理模块

4.6.1功能说明

信息管理模块主要完成下面的功能。

留言管理;添加管理员; 编辑管理员;设定等级;配置权限;重新登录;安全退出;用户等级。

以上的功能完成了整个论坛的配置,用户的管理,管理员的管理都可以通过对应的链接来完成。

4.6.2功能实现

---------------------------------------------------------------------------------------------------------------

留言管理:msend.jsp

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>发送短消息</title>

<style type="text/css">

<!--

.style2 {color: #FFFFFF}

td{font-size:13px;color:#868686}

th{font-size:15px}

-->

</style>

</head>

<body><br>

<br>

<%

String acid=request.getParameter("id");

%><form name="form1" method="post" action="actsend.jsp">

<table width="480" border="0" align="center" cellspacing="1" bgcolor="#cccccc">

<tr bgcolor="#7188e0">

<th colspan="2"><span class="style2">发 送 留 言</span></th>

</tr>

<tr bgcolor="#f8f8f8">

<td width="79"><div align="right">收信人ID:</div></td>

<td width="364"><% if(acid == null){ %>&nbsp;<input name="acid" type="text" id="acid" size="20" style="BORDER: #aaaaaa 1px solid;color:#686868;"><% }else{%>

&nbsp;<input name="acid" type="hidden" id="acid" value="<%=acid%>"><% out.print(acid);}%></td>

</tr>

<tr bgcolor="#f8f8f8">

<td><div align="right">留言主题:</div></td>

<td>&nbsp;<input name="title" type="text" id="title" size="30" style="BORDER: #aaaaaa 1px solid;color:#686868;">

</td>

</tr>

<tr bgcolor="#f8f8f8">

<td><div align="right">留言内容:<br>

≤100汉字&nbsp; </div></td>

<td>&nbsp;<textarea name="text" cols="45" rows="5" id="text" style="BORDER: #aaaaaa 1px solid; background:#f8f8f8; color:#686868; overflow:auto;"></textarea></td>

</tr>

<tr bgcolor="#f8f8f8">

<th colspan="2">&nbsp; <input name="imageField" type="image" src="../img/next1.gif" onMouseOver="this.src='../img/next2.gif'" onMouseout="this.src='../img/next1.gif'" width="60" height="22" border="0"> &nbsp;<a href="javascript:history.back()"><img src="../img/close1.gif" width="60" height="22" border="0" onMouseOver="this.src='../img/close2.gif'" onMouseout="this.src='../img/close1.gif'"></a></th>

</tr>

</table>

</form>

</body>

</html>

本页面主要实现对注册用户之间的留言管理,可以方便的在用户之间留言,这样增加了消息的隐蔽性,其他用户是接收不到的。

---------------------------------------------------------------------------------------------------------------

4.6.3程序运行过程截图

留言管理:msend.jsp

图4.7 留言管理

第五章 结论

在该系统的开发过程中采用了当今流行的多种热门技术,在开发过程中严格遵守正规软件系统开发的流程,本系统在开发过程中利用JSP和JavaBean相结合的技术充分体现了java这一语言一次开发处处运行的特点。开发中严格遵守软件工程中技术和说明文档的书写和备份,为系统测试和维护提供一个良好的书面说明。

本系统实现了大部分论坛所拥有的功能。使用了JSP和JavaBean相结合的这门技术使系统的可移植性得到很大的提高,在系统将来使用范围进一步扩大的情况下本系统可以在原有的基础上作升级和拓展。

参考文献(References)

[1]彭木根. 数据仓库技术与实现[M]. 电子工业出版社,2002-6

[2]Lou Agosta. 数据仓库技术指南[M]. 人民邮电出版社,2000-11

[3]Efrem G.Mallach. Decision Support and Data Warehouse Systems. 清华大学出版社,2001-1

[4]Marty Hall著,邓英才译. Servlet与JSP核心技术. 人民邮电出版社,2001-10

[5]Michael Abbey, Michael J. Corey, lan Abramson 著,王兰成译. Oracle 8i初学者指南. 机械工业出版社,2001-4

[6] Geng Xiangyi. JAVA Course Design. Tsinghua University Press, 2001-6

[7] Edited by Feisi Technology Product R&D Center. Detailed Explanation of JSP Application Development. Electronic Industry Press, 2002-1

[8] Edited by Feisi Technology Product R&D Center. Detailed Explanation of JAVA TCP/IP Application Development. Electronic Industry Press, 2002-1

[9] Edited by Wangguan Technology. One Hundred Cases of JavaScript Fashion Programming. Mechanical Industry Press, 2001.

[10] Hans Bergsten. He Jianhui, translated by Xu Junjuan. JSP Design. China Electric Power Press, 2004-11

[11] Hans Bergsten . Java Server Pages. 3rd Edition. O'Reilly Publisher, December 2003.

thank you

In the development process of this system, I have received many kinds of help and cooperation. I would like to thank the school leaders for their attention and the guidance teacher Hu Jun for his help in many aspects. At the same time, I would like to thank all the people who provided help during the project development process.

Thanks to my mentor, Mr. Hu Jun, his rigorous and meticulous style has always been a role model for me in work and study; your persuasive teaching and eclectic thinking have given me endless inspiration. The design details and data of this paper are inseparable from your careful guidance. Your serious scientific attitude, rigorous academic spirit, and work style of striving for perfection have deeply infected and inspired me. Help me to quickly integrate into this new design. Thanks to my roommates, who come from various regions and gathered in this strange city. It is you and I who maintain the brotherly relationship between each other and maintain the harmony of family in the dormitory. The days we were together, I will remember forever.

When the dissertation is about to be completed, I can't calm down. From the beginning of entering the project to the successful completion of the dissertation, how many respectable teachers, classmates and friends have given me silent help. Please accept my sincere thanks here!

Guess you like

Origin blog.csdn.net/m0_66999594/article/details/128678563