基于Struts框架的在線購物系統(tǒng)設計與實現(xiàn)-畢業(yè)論文外文文獻翻譯_第1頁
基于Struts框架的在線購物系統(tǒng)設計與實現(xiàn)-畢業(yè)論文外文文獻翻譯_第2頁
基于Struts框架的在線購物系統(tǒng)設計與實現(xiàn)-畢業(yè)論文外文文獻翻譯_第3頁
基于Struts框架的在線購物系統(tǒng)設計與實現(xiàn)-畢業(yè)論文外文文獻翻譯_第4頁
基于Struts框架的在線購物系統(tǒng)設計與實現(xiàn)-畢業(yè)論文外文文獻翻譯_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

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框架的在線購物系統(tǒng)設計與實現(xiàn)摘要:Struts目前是一個基于MVC的流行的Web應用開發(fā)框架。它在開放,大型和可擴展的基于J2EE的Web應用程序開發(fā)中占據(jù)重要地位。通過結合電子商務實際運行過程與開發(fā)需求,本文對MVC實際實現(xiàn)技術進行了明確分析,分析和描述了Struts框架。最后給出了類別

36、管理模塊的示范示例,詳細解釋了基于Struts框架的在線購物系統(tǒng)的技術實現(xiàn),并介紹了相關章節(jié)的功能描述。通過實際應用,顯示系統(tǒng)提高了平臺的安全性和穩(wěn)定性。 1.引言 隨著互聯(lián)網(wǎng)技術的發(fā)展,網(wǎng)絡服務在人們日常生活中起著越來越重要的作用。人們期望他們可以在一個方便的方式和很短的時間內獲得滿意的服務或貨物。因此,電子商務系統(tǒng)在這個時刻起著非常關鍵的作用。一方面,人們在網(wǎng)上查看貨物非常方便,也縮短了人們購物的時間。另一方面,對于企業(yè)來說,縮短了中間環(huán)節(jié),可以減少地域限制,降低庫存壓力,大大節(jié)省了經(jīng)營成本。但是,這個系統(tǒng)也面臨著電子商務形式變化很大的問題,結果,內部結構可以是復雜和變化的。那么怎么處理呢

37、?基于Struts 1的開發(fā)模式,可以有效地應對這些不同的需求。它完全改變了傳統(tǒng)的J2EE開發(fā)模式,即顯示,控制和業(yè)務的耦合,使得軟件重用困難,團隊合作與分工困難,開發(fā)時間長,成本高。因此,本文基于MyEclipse的集成開發(fā)環(huán)境和使用MySQL作為后端數(shù)據(jù)庫,MVC OF Struts設計了一個跨平臺,可擴展的B / S電子商務系統(tǒng)。該系統(tǒng)運行在互聯(lián)網(wǎng)上,用戶可以瀏覽商品并自由購買,甚至可以選擇支付方式。這個系統(tǒng)創(chuàng)新了傳統(tǒng)的購物,這樣可以讓人們在家里購買自己想要的東西。系統(tǒng)的計算結果表明系統(tǒng)運行良好,其安全性和可擴展性也很高。2.引言介紹Struts 2是一個特殊的MVC框架。 它結合了功能

38、的Servelet和JSP,并繼承了各種功能MVC,它根據(jù)J2EE的變化和擴展特性。 Struts有三個主要部分:控制器負責處的Action通過具體操作; JSP頁面(view); 適用業(yè)務邏輯包裝。 Struts的主控制器(ActionServlet)從客戶端接收請求到系統(tǒng)分配的路由(Struts-config。xml)HTTP請求對象到另一個Action。 在這些行動對象,將使業(yè)務運營和運營后,它ActionServlet轉移到JSP,并進行處理結果將返回給客戶。 包裝數(shù)據(jù)通過行動表單可以在模型中相互使用視圖。 Struts的工作原理如圖1所示。電子分析與設計商務系統(tǒng)3.1 系統(tǒng)的需求分析

39、和案例設計實現(xiàn)電子商務系統(tǒng)的目的通過這個系統(tǒng)的建設。 最重要的事情是吸引客戶了解網(wǎng)站的主要產(chǎn)品,例如主要銷售的電子商務網(wǎng)站兒童鞋或兒童服裝等。 對于交易,要建立面向消費者的B到C銷售模式,必須實現(xiàn)產(chǎn)品在線整合付款和物流服務。 此外,它需要制作定制的搜索引擎和數(shù)據(jù)分析系統(tǒng)找到潛在的和關鍵的客戶。 還需要分析建立科學決策體系的市場趨勢3。窗體底端因此,系統(tǒng)需求說明如下:電子商務系統(tǒng)包括兩個子系統(tǒng);一個是前臺銷售和展示。 當客戶登錄后,他們可以自由地查看并搜索自己喜歡的內容產(chǎn)品(例如:非貨品,新來港人士)。同時,客戶可以把他們喜歡的產(chǎn)品放在一個“購物車”,他們可以稍后修改,(添加或刪除),那么他們可

40、以提交訂單以進行服務反薪。 另一個子系統(tǒng)在后臺管理系統(tǒng)。 商家可以管理相關信息發(fā)布,打字和更改。 它也可以管理搜索訂單并管理注冊客戶端在線銷售系統(tǒng)。 同時可以分析消費者行為,這可以為更好的科學提供證據(jù)為公司做出決定 圖。 (2)是這種搜索的用例系統(tǒng)。3.2 網(wǎng)上購物系統(tǒng)的E-R設計PowerDesigner 3,4是Sybase的CASE工具集,它可以制作數(shù)據(jù)流程圖,概念數(shù)據(jù)模型,物理數(shù)據(jù)模型也可以控制生成的數(shù)據(jù)模型。 這個系統(tǒng)使用PowerDesigner設置數(shù)據(jù)并引入E-R模型到MySQL,并生成物理數(shù)據(jù)表。 因此,根據(jù)上述說明,結合需要和描述2.1,E-R的設計可以完成。然而,有許多系統(tǒng)

41、數(shù)據(jù)庫表,這里列出了一些重要的數(shù)據(jù)表。該他們之間的關系將在這里解釋。 具體E-R的設計處于(圖3)。3.3 在線購物系統(tǒng)的結構設計在本文中,系統(tǒng)使用基于MVC的Struts,這為開發(fā)人員做出了很大的便利模塊化開發(fā)。 它大大增加了代碼的可重用性和可維護性,也采取跨平臺化考慮到這個系統(tǒng)。 圖。 (4)顯示這個在線購物系統(tǒng)的設計模式。視圖負責系統(tǒng)的視覺主題和實現(xiàn)和View由JSP和Action Form組成豆。 JSP包含靜態(tài)HTML,CSS,Div和Struts標簽數(shù)據(jù)庫。 Action Form bean負責數(shù)據(jù)JSP和Model之間的傳輸??刂破饔葾ction Servlet組成。 其任務是:首先,它必須完成所有初始化的工作,即讀取Struts-config中的信息。 xml并攔截匹配Action Servlet的URL地圖; 第二,根據(jù)攔截請求啟動Action Form bean; 最后找到Action Mapping中的相應Action子類:i沒有相應的Action,然后發(fā)送請求到JSP;如果有相應的Action,則啟動ActionFormbean并使用HTTP填充數(shù)據(jù)及其屬性,并保存這些結果請求其他Action或JSP使用。在模型4中,具體業(yè)務邏輯運算由Action完成。為了

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論