基于Struts框架的在线购物系统设计与实现-毕业论文外文文献翻译_第1页
基于Struts框架的在线购物系统设计与实现-毕业论文外文文献翻译_第2页
基于Struts框架的在线购物系统设计与实现-毕业论文外文文献翻译_第3页
基于Struts框架的在线购物系统设计与实现-毕业论文外文文献翻译_第4页
基于Struts框架的在线购物系统设计与实现-毕业论文外文文献翻译_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、附 录Design and Implementation of Online Shopping System Based on the Struts Framework Abstract: Struts is currently a prevalent Web application development framework based on MVC. It has prominence in the open, large and extensible J2EE-based Web application development. Through combining the actual

2、operation process of E-commerce enterprise with the developed requirement, this paper categorically analyses MVC actual implementation technology, analyses and describes the Struts framework. Finally it gives a demonstrative example of Category management module, which explains in detail technical i

3、mplementation to E-Online Shopping System based Struts framework and presents function description of correlative constitution section. By practical application, it shows the system improves platforms security and stability.1. INTRODUCTION With the development of internet technology, network service

4、 plays an increasingly important role in peoples daily life. People expect that they can get the satisfied service or goods in a convenient way and in very short time. Hence, the electronic commerce system at this moment plays a very critical part. On one hand, it is very convenient for people to lo

5、ok at the goods online and it also shortens peoples time period for shopping. On the other hand, for the enterprise, it shortens intermediate links, and it can reduce the geographic restrictions and decreases the merchandise inventory pressure, therefore, it can greatly save business operating cost.

6、 However, this system also faces problems that the form of ecommerce is very changeable; as a result, the inner structural can be complex and varied. Then, how to deal with that? Based on the development model of Struts 1, it can effectively deal with these varied requirements. It completely changes

7、 the previous traditional J2EE development mode that is the coupling of display, control and business which makes software reuse difficult, cooperation and division of the team difficult, development time long and cost high. Therefore, this article based on the integrated development environment of

8、MyEclipse and using MySQL as the backend database, the MVC OF Struts designed a crossplatform, extensible B/S electronic commerce system. This system is runs on the internet where users can browse the goods and buy them freely, they can even choose the payment method. This system innovates the tradi

9、tional shopping, which can make people buy what they want at home. The computational results of the system states that the system operates well and that its security and expandability are also high.2. INTRODUCTION OF STRUTSStruts 2 is an exceptional MVC frame. It combines features of Servelet and JS

10、P and inherits various features of MVC, and it changes and extends according to the J2EES characteristic. There are three main parts of Struts: The controller is responsible for the Action that is processed by a specific operation; JSP page (view); that applies business logic packaging. The master c

11、ontroller of Struts (ActionServlet) receives the request from client and according to the allocated route of the system (Struts-config. xml) HTTP requests the objects to the other Action. In these action objects, it will make business operation and after operation, it will transfer from ActionServle

12、t to JSP, and the processed results will be returned to clients. The packaging data through Action Form can be mutual used in Model and View. The working principle of Struts is showing in Fig. (1).3. THE ANALYSIS AND DESIGN OF ELECTRONIC COMMERCE SYSTEM3.1. The Demand Analisis and Case Design of the

13、 SystemThe aim of this electronic commerce system is realizedby the construction of this system. The most important thing is to attract customers to know the main product of the website, for instance an e-commerce website which mainly sells childrens shoes or childrens clothes and so on. For transac

14、tions, it has to build B to C sales model which are consumer facing, and it has to realize the integration of products, online payment, and logistic services. Moreover, it needs to make a customized search engine and data analysis system to find the potential and key customers. It also needs to anal

15、yze the market trend to build a scientific decision system 3.Therefore, the system requirement description is as following:electronic commerce system includes two subsystems; one is for the front desk sale and display. When clients log in, they can freely look over and search their favorite products

16、 (for example: off-price goods, new arrivals). Meanwhile, customers can put the products they like in a “shopping cart” and which they can later modify, (add or delete), then they can submit the order form to service counter to pay. The other subsystem is in the backstage management system. Merchant

17、s can manage the relevant information published, typed-in and alteration. It can also manage the search of the order and manage the registered clients of on-line sales system. Meanwhile, it can analyze consumer behavior, which can provide evidence for better scientific decision for the corporation.

18、Fig. (2) is the use case of this eshopping system.3.2. The E-R Design of Online Shopping SystemPowerDesigner 3, 4 is the CASE tool set of Sybase, it can make data flowchart, concept data model, physical data model and can also control the generated data model. This system uses PowerDesigner to set u

19、p data and induct E-R model to MySQL, and generate physical data sheets. Therefore, according to the above description, combined with the need and description of 2.1, the design of E-R can be finished. However, there are numerous system database sheets, only some important database sheets are listed

20、 here. The relationship among them will be explained here. The specific design of E-R is in (Fig. 3).3.3. Structure Design of Online Shopping System In this article, the system uses Struts based on MVC, which makes great convenience for the developer to make modularization exploitation. It greatly i

21、ncreased codes reusability and maintainability, and it also takes the crossplatform of this system into consideration. Fig. (4) shows the design model of this online shopping system. View is responsible for the systems visual theme and realization, and View is composed by JSP and Action Form bean. J

22、SP contains static HTML, CSS, Div and Struts label database. Action Form bean is responsible for the data transmission between JSP and Model. Controller is composed by Action Servlet. Its task are:first, it has to finish all the initialized work, that is to read the information in Struts-config. xml

23、 and intercept the matching map of URL by Action Servlet; second, according to the intercepting request initiate Action Form bean; last, to find the corresponding Action subclass in Action Mapping: if there are no corresponding Action, then transmit the request to JSP; if there are corresponding Act

24、ion, then initiate ActionForm bean and use HTTP to fill the data and its property, and save these results in request for other Action or JSP to use. in the Model 4, the specific business logic operationis finished by Action. In order to reduce the coupling relationshipbetween business logic and data

25、base manipulation,the DAO is used to separate business logic and data access.It can increase the flexibility and maintainability of systemfor that DAO model Action 5 and provides abstract data access port. Therefore, Model doesnt need to care about selection, insertion, deletion, and updating, hence

26、, it avoids mixed call statement in service code, so the business practice can be much clearer and on the other hand, because of the separation of data access port and data access, which can make the developer concentrate on business logic code rather than datas selection, insertion, deletion, and c

27、heck. 4. THE IMPLEMENTATION OF ELECTRONIC COMMERCE SYSTEM BASED ON STRUTSStruts applied MVC design model, which separated page display, data control and business operation makes the exploitation and maintenance more convenient and reasonable. For online shopping electronic commerce system 6, 7, the

28、construction methods of all modules are basically same. Next set commodity management module 8 as an example to explain the develop process of online shopping electronic commerce system based on Struts.4.1. Design of View ModuleThe main function of View is to display data to users, and in this syste

29、m, View is composed by Struts, Div, CSS, HTML, JSP and formbean. The advantage of this is that it can avoid the coupling of Java source code and HTML statement in JSP, and it also can enhance reusability of View. It can simplify the page development, and is good for test and maintenance. First, use

30、Dreamweaver to establish JSP: 1), add and modify Category page addCategory.jsp;2), delete some category page delCategory.jsp;3), search category page searchCategory.jsp; 4), maintain category information page categoryInfoMaint.jsp. It can display all the products information and it can add, delete,

31、modify and edit the selected products. Lastly, to define and describe the CategoryFormbean. It inherited the org.apache.struts.action.ActionForm in Struts. The main function of this class is to collect and display data. The goal of data collection is to provide a business model for Model module. And

32、 display data is to show the conducted data to users. The specific steps are:First: introduce ActionForm to Struts;Second. write down the specific codes as followingpublic class MerForm extends ValidatorForm / 1.define products manufacturer private String manufacturer; / 2. define products price pri

33、vate Double sprice;/ 3.define products discount private Integer special; /omit other property,meanwhile, /generate corresponding Getter/Setter 4.2. Implementation and Design of ControllerController is the core of all operations, whenever, ActionServlet of controller deals with all the things, it dec

34、ides all the flow relation of every module in this system. Then how to finish these works? Firstly, it is necessary to register ActionServlet and Struts-config.xml in Web.xml. Web.xml is the place where Controllers modules ActionServlet and struts-config.xml are described and among these, *.do stand

35、s for requesting mapping, the specific allocations are:action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml action *.do 基于Struts框架的在线购物系统设计与实现摘要:Struts目前是一个基于MVC的流行的Web应用开发框架。它在开放,大型和可扩展的基于J2EE的Web应用程序开发中占据重要地位。通过结合电子商务实际运行过程与开发需求,本文对MVC实际实现技术进行了明确分析,分析和描述了Struts框架。最后给出了类别

36、管理模块的示范示例,详细解释了基于Struts框架的在线购物系统的技术实现,并介绍了相关章节的功能描述。通过实际应用,显示系统提高了平台的安全性和稳定性。 1.引言 随着互联网技术的发展,网络服务在人们日常生活中起着越来越重要的作用。人们期望他们可以在一个方便的方式和很短的时间内获得满意的服务或货物。因此,电子商务系统在这个时刻起着非常关键的作用。一方面,人们在网上查看货物非常方便,也缩短了人们购物的时间。另一方面,对于企业来说,缩短了中间环节,可以减少地域限制,降低库存压力,大大节省了经营成本。但是,这个系统也面临着电子商务形式变化很大的问题,结果,内部结构可以是复杂和变化的。那么怎么处理呢

37、?基于Struts 1的开发模式,可以有效地应对这些不同的需求。它完全改变了传统的J2EE开发模式,即显示,控制和业务的耦合,使得软件重用困难,团队合作与分工困难,开发时间长,成本高。因此,本文基于MyEclipse的集成开发环境和使用MySQL作为后端数据库,MVC OF Struts设计了一个跨平台,可扩展的B / S电子商务系统。该系统运行在互联网上,用户可以浏览商品并自由购买,甚至可以选择支付方式。这个系统创新了传统的购物,这样可以让人们在家里购买自己想要的东西。系统的计算结果表明系统运行良好,其安全性和可扩展性也很高。2.引言介绍Struts 2是一个特殊的MVC框架。 它结合了功能

38、的Servelet和JSP,并继承了各种功能MVC,它根据J2EE的变化和扩展特性。 Struts有三个主要部分:控制器负责处的Action通过具体操作; JSP页面(view); 适用业务逻辑包装。 Struts的主控制器(ActionServlet)从客户端接收请求到系统分配的路由(Struts-config。xml)HTTP请求对象到另一个Action。 在这些行动对象,将使业务运营和运营后,它ActionServlet转移到JSP,并进行处理结果将返回给客户。 包装数据通过行动表单可以在模型中相互使用视图。 Struts的工作原理如图1所示。电子分析与设计商务系统3.1 系统的需求分析

39、和案例设计实现电子商务系统的目的通过这个系统的建设。 最重要的事情是吸引客户了解网站的主要产品,例如主要销售的电子商务网站儿童鞋或儿童服装等。 对于交易,要建立面向消费者的B到C销售模式,必须实现产品在线整合付款和物流服务。 此外,它需要制作定制的搜索引擎和数据分析系统找到潜在的和关键的客户。 还需要分析建立科学决策体系的市场趋势3。窗体底端因此,系统需求说明如下:电子商务系统包括两个子系统;一个是前台销售和展示。 当客户登录后,他们可以自由地查看并搜索自己喜欢的内容产品(例如:非货品,新来港人士)。同时,客户可以把他们喜欢的产品放在一个“购物车”,他们可以稍后修改,(添加或删除),那么他们可

40、以提交订单以进行服务反薪。 另一个子系统在后台管理系统。 商家可以管理相关信息发布,打字和更改。 它也可以管理搜索订单并管理注册客户端在线销售系统。 同时可以分析消费者行为,这可以为更好的科学提供证据为公司做出决定 图。 (2)是这种搜索的用例系统。3.2 网上购物系统的E-R设计PowerDesigner 3,4是Sybase的CASE工具集,它可以制作数据流程图,概念数据模型,物理数据模型也可以控制生成的数据模型。 这个系统使用PowerDesigner设置数据并引入E-R模型到MySQL,并生成物理数据表。 因此,根据上述说明,结合需要和描述2.1,E-R的设计可以完成。然而,有许多系统

41、数据库表,这里列出了一些重要的数据表。该他们之间的关系将在这里解释。 具体E-R的设计处于(图3)。3.3 在线购物系统的结构设计在本文中,系统使用基于MVC的Struts,这为开发人员做出了很大的便利模块化开发。 它大大增加了代码的可重用性和可维护性,也采取跨平台化考虑到这个系统。 图。 (4)显示这个在线购物系统的设计模式。视图负责系统的视觉主题和实现和View由JSP和Action Form组成豆。 JSP包含静态HTML,CSS,Div和Struts标签数据库。 Action Form bean负责数据JSP和Model之间的传输。控制器由Action Servlet组成。 其任务是:首先,它必须完成所有初始化的工作,即读取Struts-config中的信息。 xml并拦截匹配Action Servlet的URL地图; 第二,根据拦截请求启动Action Form bean; 最后找到Action Mapping中的相应Action子类:i没有相应的Action,然后发送请求到JSP;如果有相应的Action,则启动ActionFormbean并使用HTTP填充数据及其属性,并保存这些结果请求其他Action或JSP使用。在模型4中,具体业务逻辑运算由Action完成。为了

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论