Research on SanWei Web Application System Based on Java Technology
Research on SanWei Web Application System Based on Java Technology
ae-mail: [email protected]
Abstract: With the rapid popularization of the Internet and functions [6][7].In terms of the choice of network mode, Du
the rapid development of network technology, people are (2016) and Tang (2017) both adopted B/S mode to design the
increasingly inclined to online shopping. This paper uses B/S library management system without installing other clients, and
three-layer structure, and uses JSP technology for dynamic page the test results of the system met the expectations [8][9]. Some
design. From the perspective of system security and code scholars have studied the recommendation functions of
reusability, JavaBean is used to encapsulate the key code of the e-commerce platforms. Hong (2016) introduces the
program. The background database is MySQL database. recommendation functions of several large e-commerce
"SanWei" e-commerce bookstore platform includes foreground
websites to meet the needs of users in a personalized way [10].
management and background management, mainly including
Zheng (2018) proposes a collaborative filtering algorithm to
shopping cart management, commodity search, user data
modification, commodity management and order management.
realize the platform recommendation function [11].
The system is more efficient and can create more value. Based on SSH framework, this paper designs and
implements an online book sales system named "SanWei",
Keywords: e-commerce platform; bookstore; SSH; Java; which mainly serves students in rural areas. This small B2C
MySQL e-commerce platform can provide them with targeted learning
I. Introduction guidance materials and cultivate their interest in reading, while
providing convenience for businesses to carry out sales
Information technology makes space distance no longer an business.
obstacle, and the modern information network represented by
the Internet is rapidly expanding to all aspects of people’s lives. II. System Architecture
In the development stage of the new era, education has also
become an important matter of national concern, vigorously A. SSH Framework
advocating reading to promote the development of education. SSH framework is an open source framework composed
However, physical bookstores are still rare in rural areas, and of Struts + Spring +Hibernate, which is divided into four layers:
inequity in educational resources still exists, leading to no presentation layer, business module layer, data persistence
survival opportunities for physical bookstores in the local area. layer and domain module layer [12]. The system adopts MVC
In order to facilitate people to quickly purchase books, framework, and the front-end page will not be affected by
understand the latest book information, and find the books they changes in database design and model changes, which is
are interested in, online bookstore is designed [1]. It saves conducive to the reuse of programming code, does not require a
various operating costs of physical bookstores, saves lot of code changes, reduces the workload, and is conducive to
manpower and rent, and the price of books sold also declines, the maintenance of the system in the later stage. The specific
realizing mutual benefit between buyers and sellers. form of SSH frame diagram is shown in Figure 1.
At present, the world’s largest online bookstore is Amazon,
founded by Jeff Bezos in 1994, holds a dominant position in
the industry, and its web interface contains a considerable
amount of book information. The key factors for the successful
operation of online bookstores include the richness of web
information, the review content of books purchased, the level
of detail of book information, the quality of books and the
guarantee of genuine copies, which are also important parts of
the online bookstore platform that need to be optimized.
Scholars use programming languages to design e-commerce
platform systems, which generally include modules such as
Fig.1 Frame diagram
login, shopping cart, order and administrator background
management [2][3]. Dong (2021) uses SSM framework to Strusts2.0 is an excellent implementation of the MVC
develop a series of functions [4]. Mo (2021) adopts distributed framework. The front controller selects appropriate actions to
service architecture design to realize system resource allocation process the user’s request, assembles the parameters in the
[5]; Liu (2017) and Huang (2021) adopted SSH framework user’s request into an appropriate data model, and calls the
with higher development efficiency and more comprehensive corresponding business logic for real function processing to
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:25:18 UTC from IEEE Xplore. Restrictions apply.
obtain the data required for the next view display. The service and vo. The jsp page is located in the view layer of the
controller makes the view interact with the model, and mvc three-layer structure. Action and service belong to the
separates the view from the logic. It can save processing time control layer. It is responsible for classifying and forwarding
and development space, and greatly improve development the services sent from the view layer, analyzing the business
efficiency. requirements, and submitting the request to the model layer
when it needs to interact with the database. Dao and vo belong
Spring3.0 is a hierarchical framework technology, in which to the model layer and synchronize data to the database through
the program dependency is built on a core container, and then the hibmate framework. During this period, all objects in
the application configuration is separated from the actual different layers are managed by spring. Object calls between
application code to define the creation, configuration and different layers are injected by spring containers to achieve
management methods, effectively providing enterprise services decoupling between layers. Its configuration information is
and handling exception requests. Developers can choose their located in applicationContext.xml between layers. This setting
own development levels and functions to make system is convenient for future system modification and maintenance.
development more flexible.
A. Database
Hibernate3.0 is a bridge between applications and relational
databases. Developers can use object thinking to operate This paper uses MySQL database. The database tables
databases without further considering complex database logic. mainly designed include: fenxtj (sharing recommendation
One database creates one object, and multiple databases create table), xinw (news table), shpddan (order table), shangp
multiple objects [13]. (commodity table), shangpty (commodity type table), yong
(user table), lianj (link table). Users in the database include
B. MySQL Database administrators and ordinary users. Administrators manage
MySQL database is a relational database. It stores data in order information and book information. Tables 1 to 7 are data
tables instead of putting them together to facilitate data call. It tables in the database.
can be used on multiple platforms, and has strong encryption
function to protect the privacy of password data in the Table1 Fenxtj
transmission process [14]. At the same time, it supports query Primary key
in multiple languages, and is widely used. Attribute Name Data Type Length
or not
id int 4 Yes
C. Business Process Analysis
Users who purchase books through the "SanWei" uid int 4 No
e-commerce platform need to register, then log in to the system, tuid int 4 No
view the book information on the home page, find the books pid int 4 No
they need to buy, and select the books to consult the
introduction [15]. If they want to buy, they can join the tjtype varchar 50 No
shopping cart. After generating an order, they can select a
settlement method to perform payment settlement. After the Table2 Shpddan
foreground system is completed, the book management Primary key
personnel need to complete the order management and other Attribute Name Data Type Length
or not
operation steps in the background management system, and id Int 4 Yes
select the book stock out and a series of shipment processing
pid Int 4 No
operations. Figure 2 shows the specific functional modules.
uid Int 4 No
states Int 4 No
savetime varchar 50 No
num Int 4 No
addr varchar 50 No
fkfs varchar 50 No
Table3 Yongh
Primary key
Attribute Name Data Type Length
or not
id int 4 Yes
Fig.2 Module uname varchar 50 No
upass varchar 50 No
III. System Design and Implementation
shopname varchar 50 No
The overall design of the system implementation is carried
out. Considering the scalability and maintainability of the shoppic varchar 50 No
system, the system is divided into four layers: action, dao,
407
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:25:18 UTC from IEEE Xplore. Restrictions apply.
usertype varchar 50 No location on the page.
states varchar 50 No The registration page is the page that you need to visit in
savetime varchar 50 No order to register your personal information as a user. The
information filled in is verified by validation.xml, which is an
zhi varchar 50 No
XML-based form information verification method provided by
frends varchar 50 No struts. Its function is simple and easy to understand. It only
needs to name the file xxxaction-Valida.xml (XXX must be
Table4 Shangp sure to be the same name as the form submitted action) in the
same directory as the action. Meanwhile, it uses ajax
Primary key
Attribute Name Data Type Length
or not
asynchronous transmission mechanism to query the database in
real time to see whether the user name has been registered and
id int 4 Yes
whether the password complexity meets the requirements.
spname varchar 50 No
The login window is an identity verification process
price varchar 50 No provided by the administrator. Several interceptors are
spno varchar 50 No configured for the system in the configuration file of the Struts
pic varchar 50 No framework. One is that when visiting a page configured with
an interceptor, it checks one by one to see if the information
savetime varchar 50 No submitted by the browser meets the internal requirements of the
colum varchar 50 No interceptor. When a user accesses a page with exclusive user
clicks varchar 50 No rights without logging in, the interceptor will take effect and
intercept the browser request and redirect it to the login
content varchar 50 No interface, mainly to determine whether there is a user object in
Denji varchar 50 No the session brought by the browser request.
isbn varchar 50 No 2) Shopping Cart Module
The function of the shopping cart module is to facilitate
Table5 Shangpty users to select their desired products from a large number of
Primary key or books, and then put them into the basket. The user clicks the
Attribute Name Data Type Length shopping cart icon in the upper right corner of the system, and
not
id int 4 Yes it is empty when no books are selected. Users can browse and
typename varchar 50 No
select through the chart category and price range in the menu
bar on the left side of the platform, or enter keywords in the
parenttype varchar 50 No
search box above or directly enter the books they want to buy.
After clicking the OK button, the page will display the book
Table6 Xinw
picture and price information. Users click the content, and the
Primary key or page will display the detailed content of the book, including the
Attribute Name Data Type Length
not book content introduction, publishing house, publishing time,
ID int 4 Yes and the field.
title varchar 50 No
3) Order Module
content varchar 200 No
The order module is mainly for the user to settle the goods,
savetime varchar 50 No confirm the purchase of the book and pay the corresponding
imgurl varchar 50 No amount. Users can directly click the settlement button at the
bottom right of the book details page, or select all the books
Table7 Lianj purchased in the shopping cart to pay for settlement together.
In this process, users need to select the consignee contact
Primary key or
Attribute Name Data Type Length
not information and address information filled in during
ID int 4 Yes registration, or add new consignee and address information. If
users need to reconsider whether to purchase books, they can
linkname varchar 50 No
return before paying, and the order will remain in the status of
linkurl varchar 50 No waiting for payment so that they can pay again later. After the
savetime varchar 50 No order settlement is completed, the user only needs to wait for
the platform administrator to operate the shipment. Part of the
B. Foreground Module Function order code is as follows:
1) Register/Login Module public ActionForward sendorder(ActionMapping mapping,
For users who log in for the first time, they need to register ActionForm form,
first, click the free registration button on the left side of the HttpServletRequest request, HttpServletResponse response) {
page, fill in according to the content that appears, fill in the ShpddanDao dao = ( ShpddanDao)Info.getDao(request, "
name, password, confirm password, avatar settings and other
ShpddanDao");
contents in turn. After registration, they can log in at the same
408
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:25:18 UTC from IEEE Xplore. Restrictions apply.
String id = request.getParameter("pid"); consignee address. The order delivery is generally within 24
Yongh u = (Yongh)request.getSession().getAttribute("user"); hours after the user pays. The administrator can set a reminder
Shpddan o = new Shpddan(); to check whether the order has been delivered. Finally,
o.setPid(id); platform personnel can delete this order record after all orders
are completed or returns occur.
dao.insert(o);
request.setAttribute("suc", ""); 5) Friendly Link Module
return mapping.findForward("send"); Setting up friendly links can increase the access of web
} crawlers, make more people know about the existence of the
"SanWei" website, play a role of drainage and thus improve
C. Background Module Function the popularity of the website. E-commerce platform operators
1) Administer Login Module will have more opportunities to gain profits. Administrator can
Administrator enters the background management system add this function by entering the website name and address in
through the website URL link. The login page is composed of the corresponding location.
two small parts, blue and white. After the administrator enters D. Interface design and implementation
the user name and password, he clicks the login button to see
the background management page. The background The interface of e-commerce platform is very important for
management page is also composed of blue and white colors. consumers to shop. A simple and clear interface can enable
On the left is the menu of each function module, on the top is users to improve purchasing efficiency and reduce users'
the internal message notification, and in the middle is the purchasing time. The home page of the "SanWei" bookstore is
specific display of each module. This design enables dominated by orange and white, as shown in figure 3. The left
administrators to quickly find the content to be added and side is the platform logo and the top is the search box. The
modified, which is easy to operate and learn. controls on the home page are reasonably distributed, so that
users can easily open the shopping experience.
2) User Management Module
In this module, the administrator can click the previous
and next buttons to view the user information of the "SanWei"
platform and manage the user details. If a user applies for
account cancellation or violates the rules, the administrator
can delete the user information.
3) Commodity Management Module
The main object of the design of "SanWei" e-commerce
platform is book commodities. The platform needs to
constantly add new books and materials for users to buy. The
administrator can click to add a book, input the specific
information of the book into the corresponding column, and
click OK to see the newly added book in the list. At the same
time, the administrator can manage book types. If they want to Fig.3 foreground interface
add books in other fields to enrich the books that users can buy,
they can click the Add button to add. Similarly, the IV. Conclusions
administrator can delete a type. The code to manage the book In the context of the rapid development of the Internet, this
type is as follows: paper uses SSH framework to deal with different layers of
public ActionForward addbigtype(ActionMapping mapping, business logic, and mainly adopts the B/S architecture mode.
ActionForm form, No matter which platform the application program is on, it
HttpServletRequest request, HttpServletResponse response) { does not need to build a client, which reduces system coupling
and increases the efficiency of system development and
String ys = request.getParameter("ys");
maintenance. At the same time, according to the system
if(ys==null)ys=""; requirements, functional modules and database tables are
if(!ys.equals("")) designed. The project structure is clear and convenient for
{ subsequent expansion functions. "SanWei" e-commerce
Shangpty ystype = new Shangpty(); bookstore platform runs smoothly and can better meet the
ystype.setTypename(ys); needs of users. In the future, the research direction is to add
ystype.setParenttype("publishing house"); the recommendation algorithm, and to join the Hadoop
platform in the case of a large amount of data, so as to prevent
dao.insert(ystype);
the system from collapsing due to excessive pressure on the
}
server.
4) Order Management Module
References
The administrator can view whether the order has been
paid, and can see the details of the order payment time, [1] Han M, Tan D, Zhang Y, et al. (2017) The Design and Implementation
of Online Bookstore. J. Advanced Management Science, 6(1): 73-75.
payment method, whether to use the discount, and the
[2] Cai Z, Liu Y, Gan Y, et al. (2019) Design and implementation of online
409
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:25:18 UTC from IEEE Xplore. Restrictions apply.
mall system based on java web. J. International Journal of Library Management System Based on Struts and Hibernate. J. China
Performability Engineering, 15(12): 3237. Management Informationization, 20(20):156-157.
[3] Zhang Y F, Jin J H. (2021) System design of online bookstore based on [10] HONG L, REN Q Y, LIANG S X. (2016) A comparative study of
JSP J. Information Technology and Informatization, (08):110-112. information servicequality of E-commerce sites'recommender
[4] Dong Y, Liu B, Qi X W. (2021) Design and Implementation of Wugong systems-Take Taobao, Jingdong and Amazon asexamples. J. Library
Rough Cloth E-commerce Platform. J Scientific and Technological and Information Service,60(23):97-110.
Innovation, (07):85-86. [11] Zheng P, Wang Y M. (2018) Based on similarity and implied trust
[5] Mo J C, Tian X Y. (2021) Design of online shopping platform system recommendation algorithm. J. Computer Systems & Applications, 27
based on Java. J Mechanical & Electrical Engineering Technology, (3): 118-124.
50(01):103-105. [12] Zhou, Rui. (2017) Research on the framework of tourism e-commerce
[6] Liu F. (2017) Construction of Online Marketing System of Agricultural platform. J. Boletin Tecnico/Technical Bulletin, 55(18): 649 – 655.
Special Products Based on SSH Framework. J. Software Guide, [13] Gregory, G., & Bauer, C. (2015) Java persistence with hibernate. Simon
16(11):94-97. and Schuster. United States of America.
[7] Huang Z Z. (2021) Design and implementation of "ibook" bookstore [14] Győrödi C A, Dumşe-Burescu D V, Győrödi R Ş, et al. (2021)
mall based on SSH. J Science and Technology & Innovation, Performance impact of optimization methods on MySQL
(16):173-174+178.DOI:10.15913/j.cnki.kjycx.2021.16.077. document-based and relational databases. J. Applied Sciences, 11(15):
[8] Du H T, Yang W T, Li Z, et al. (2016) Web-based online book ordering 6794.
system analysis and design. J. Internet of Things Technologies, 2016, 6 [15] Yan B, Wu C, Yu R, et al. (2021) .Big data-based E-commerce
(6): 83-84 + 86. transaction information collection method.. J. Complexity, 2021.
[9] Tang C H, Li H J, Zeng L. (2017) Design and Implementation of
410
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:25:18 UTC from IEEE Xplore. Restrictions apply.