A web bookstore implemented by java

The download address of this demo teaching video: http://www.wisdomdd.cn/Wisdom/resource/articleDetail.htm?resourceId=1088

The example introduces the Web online bookstore implemented by Java, including project source code, papers, code explanations and database scripts. The online bookstore is divided into multiple columns, each column has a corresponding book list, click to view the book details, and then you can buy and Pay through ICBC

If the video is not clear, please maximize the viewing of the demo

A web bookstore implemented by java

The example code corresponding to the project can be obtained through the [Download Example] button on the right

Development tools: MyEclipse10, JDK1.7, Tomcat7, MySql5.5.60

[Contents included in the project] (see the figure below):

【Thesis】 Thesis article

【Database Design】 Database Script

[Documentation] Explanation of code details

[Project source code] Web project source code

A web bookstore implemented by java

【Example function】

front desk:

1). User module functions include:

* User registration:

> The form page is verified by jQuery (including ajax asynchronous requests)

# Check when the input box loses focus;

# Validate all input boxes when submitting;

# Hide the error message when the input box gets focus.

> The form page uses a one-time graphic verification code;

> Do the form validation again in the servlet.

> When the registration is successful, use javaMail to send an activation email to the registered user, the email contains a link for activation, and the link contains the activation code parameter;

* User activation: query the user through the activation code, if the user cannot be queried, then the activation code is invalid! The activation code is generated using uuid!

* User login:

> The form validation is the same as the registration function;

> When the login is successful, the current user name will be saved in the cookie, so that it can be displayed in the input box of the login page!

* User exit: destroy session

2). Classification module

* Query all categories:

> There are 1 and 2 classifications

> Use accordion menus (Javascript components) to display categories in the page.

3). Book module:

* Query by category

* Search by author

* Search by publisher

* Fuzzy query by book title

* Multi-condition combination query

* Query by id

Except for querying by id, the others are paging queries.

Technical Difficulties:

> Combined query: Piece together SQL statements based on multiple conditions.

> Conditional paging query: Conditions may be lost. Use a custom PageBean to pass pagination data!

> Pagination on the page: the display of the page number list is not easy to calculate!

4). Shopping cart module:

* add entry

* Modify the number of entries

* delete entry

* Bulk delete entries

* my shopping cart

* Query the checked item

The shopping cart is not using sesson or cookies, but is stored to the database.

Technical Difficulties:

> When adding an entry, if the entry for the same book is added twice, it is not added, but merged;

> Request the server side when using ajax when modifying the quantity, and the server side returns json.

> A lot of js code

5). Order module:

* Generate orders

* My Order

* View order details

* s

* Order confirmation receipt

* cancel order

Technical Difficulties:

> Using epay online payment platform:

# Connect with the Yibao payment gateway according to the payment scope of Yibao.

# Receive the two response mechanisms of Yibao, and reply to the point-to-point response.

# Handle the repeated confirmation of the database generated by multiple responses.

Backstage

1). Administrator

* Admin login

2). Classification management

* Added 1st class category

* Add 2-level category: You need to specify the 1-level category for the 2-level category

* Edit level 1 category

* Edit Level 2 Category: You can modify the Level 1 category you belong to

* Delete level 1 category: When there is a subcategory, it cannot be deleted

* Delete Level 2 Category: Books cannot be deleted when there are books under the current Level 2 category

* View all categories

3). Book management

* Various inquiries: same as the front desk

* Add books:

> Upload Image

> The page uses a dynamic drop-down list to display the second-level category. When the first-level category is specified, the second-level category drop-down list dynamically displays the names of all the second-level categories under the first-level category.

* Modify Book: Similar to adding a book, also uses a dynamic drop-down list

* Deleting a book: You need to delete the picture corresponding to the book, and then delete the book

4). Order management

* Various inquiries

* Order shipped

* cancel the order

【Project configuration】

1. Modify the data source configuration information in c3p0-config.xml

<c3p0-config>
<default-config>
<property name="jdbcUrl">
<![CDATA[
jdbc:mysql://localhost:3306/goods?useUnicode=true&characterEncoding=UTF8&useServerPrepStmts=true&prepStmtCacheSqlLimit=256&cachePrepStmts=true&prepStmtCacheSize=256&rewriteBatchedStatements=true
]]>
</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="user">root</property>
<property name="password">root</property>
<property name="acquireIncrement">3</property>
<property name="initialPoolSize">10</property>
<property name="minPoolSize">2</property>
<property name="maxPoolSize">10</property>
</default-config>
</c3p0-config>

2. Import goods.sql into the database

A web bookstore implemented by java

【Example renderings】

Access link: http://localhost:8080/goods/ Login information: liSi/123

A web bookstore implemented by java

A web bookstore implemented by java

A web bookstore implemented by java

A web bookstore implemented by java

A web bookstore implemented by java

A web bookstore implemented by java

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325771310&siteId=291194637