




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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框架的在線購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)摘要:Struts目前是一個(gè)基于MVC的流行的Web應(yīng)用開發(fā)框架。它在開放,大型和可擴(kuò)展的基于J2EE的Web應(yīng)用程序開發(fā)中占據(jù)重要地位。通過(guò)結(jié)合電子商務(wù)實(shí)際運(yùn)行過(guò)程與開發(fā)需求,本文對(duì)MVC實(shí)際實(shí)現(xiàn)技術(shù)進(jìn)行了明確分析,分析和描述了Struts框架。最后給出了類別
36、管理模塊的示范示例,詳細(xì)解釋了基于Struts框架的在線購(gòu)物系統(tǒng)的技術(shù)實(shí)現(xiàn),并介紹了相關(guān)章節(jié)的功能描述。通過(guò)實(shí)際應(yīng)用,顯示系統(tǒng)提高了平臺(tái)的安全性和穩(wěn)定性。 1.引言 隨著互聯(lián)網(wǎng)技術(shù)的發(fā)展,網(wǎng)絡(luò)服務(wù)在人們?nèi)粘I钪衅鹬絹?lái)越重要的作用。人們期望他們可以在一個(gè)方便的方式和很短的時(shí)間內(nèi)獲得滿意的服務(wù)或貨物。因此,電子商務(wù)系統(tǒng)在這個(gè)時(shí)刻起著非常關(guān)鍵的作用。一方面,人們?cè)诰W(wǎng)上查看貨物非常方便,也縮短了人們購(gòu)物的時(shí)間。另一方面,對(duì)于企業(yè)來(lái)說(shuō),縮短了中間環(huán)節(jié),可以減少地域限制,降低庫(kù)存壓力,大大節(jié)省了經(jīng)營(yíng)成本。但是,這個(gè)系統(tǒng)也面臨著電子商務(wù)形式變化很大的問題,結(jié)果,內(nèi)部結(jié)構(gòu)可以是復(fù)雜和變化的。那么怎么處理呢
37、?基于Struts 1的開發(fā)模式,可以有效地應(yīng)對(duì)這些不同的需求。它完全改變了傳統(tǒng)的J2EE開發(fā)模式,即顯示,控制和業(yè)務(wù)的耦合,使得軟件重用困難,團(tuán)隊(duì)合作與分工困難,開發(fā)時(shí)間長(zhǎng),成本高。因此,本文基于MyEclipse的集成開發(fā)環(huán)境和使用MySQL作為后端數(shù)據(jù)庫(kù),MVC OF Struts設(shè)計(jì)了一個(gè)跨平臺(tái),可擴(kuò)展的B / S電子商務(wù)系統(tǒng)。該系統(tǒng)運(yùn)行在互聯(lián)網(wǎng)上,用戶可以瀏覽商品并自由購(gòu)買,甚至可以選擇支付方式。這個(gè)系統(tǒng)創(chuàng)新了傳統(tǒng)的購(gòu)物,這樣可以讓人們?cè)诩依镔?gòu)買自己想要的東西。系統(tǒng)的計(jì)算結(jié)果表明系統(tǒng)運(yùn)行良好,其安全性和可擴(kuò)展性也很高。2.引言介紹Struts 2是一個(gè)特殊的MVC框架。 它結(jié)合了功能
38、的Servelet和JSP,并繼承了各種功能MVC,它根據(jù)J2EE的變化和擴(kuò)展特性。 Struts有三個(gè)主要部分:控制器負(fù)責(zé)處的Action通過(guò)具體操作; JSP頁(yè)面(view); 適用業(yè)務(wù)邏輯包裝。 Struts的主控制器(ActionServlet)從客戶端接收請(qǐng)求到系統(tǒng)分配的路由(Struts-config。xml)HTTP請(qǐng)求對(duì)象到另一個(gè)Action。 在這些行動(dòng)對(duì)象,將使業(yè)務(wù)運(yùn)營(yíng)和運(yùn)營(yíng)后,它ActionServlet轉(zhuǎn)移到JSP,并進(jìn)行處理結(jié)果將返回給客戶。 包裝數(shù)據(jù)通過(guò)行動(dòng)表單可以在模型中相互使用視圖。 Struts的工作原理如圖1所示。電子分析與設(shè)計(jì)商務(wù)系統(tǒng)3.1 系統(tǒng)的需求分析
39、和案例設(shè)計(jì)實(shí)現(xiàn)電子商務(wù)系統(tǒng)的目的通過(guò)這個(gè)系統(tǒng)的建設(shè)。 最重要的事情是吸引客戶了解網(wǎng)站的主要產(chǎn)品,例如主要銷售的電子商務(wù)網(wǎng)站兒童鞋或兒童服裝等。 對(duì)于交易,要建立面向消費(fèi)者的B到C銷售模式,必須實(shí)現(xiàn)產(chǎn)品在線整合付款和物流服務(wù)。 此外,它需要制作定制的搜索引擎和數(shù)據(jù)分析系統(tǒng)找到潛在的和關(guān)鍵的客戶。 還需要分析建立科學(xué)決策體系的市場(chǎng)趨勢(shì)3。窗體底端因此,系統(tǒng)需求說(shuō)明如下:電子商務(wù)系統(tǒng)包括兩個(gè)子系統(tǒng);一個(gè)是前臺(tái)銷售和展示。 當(dāng)客戶登錄后,他們可以自由地查看并搜索自己喜歡的內(nèi)容產(chǎn)品(例如:非貨品,新來(lái)港人士)。同時(shí),客戶可以把他們喜歡的產(chǎn)品放在一個(gè)“購(gòu)物車”,他們可以稍后修改,(添加或刪除),那么他們可
40、以提交訂單以進(jìn)行服務(wù)反薪。 另一個(gè)子系統(tǒng)在后臺(tái)管理系統(tǒng)。 商家可以管理相關(guān)信息發(fā)布,打字和更改。 它也可以管理搜索訂單并管理注冊(cè)客戶端在線銷售系統(tǒng)。 同時(shí)可以分析消費(fèi)者行為,這可以為更好的科學(xué)提供證據(jù)為公司做出決定 圖。 (2)是這種搜索的用例系統(tǒng)。3.2 網(wǎng)上購(gòu)物系統(tǒng)的E-R設(shè)計(jì)PowerDesigner 3,4是Sybase的CASE工具集,它可以制作數(shù)據(jù)流程圖,概念數(shù)據(jù)模型,物理數(shù)據(jù)模型也可以控制生成的數(shù)據(jù)模型。 這個(gè)系統(tǒng)使用PowerDesigner設(shè)置數(shù)據(jù)并引入E-R模型到MySQL,并生成物理數(shù)據(jù)表。 因此,根據(jù)上述說(shuō)明,結(jié)合需要和描述2.1,E-R的設(shè)計(jì)可以完成。然而,有許多系統(tǒng)
41、數(shù)據(jù)庫(kù)表,這里列出了一些重要的數(shù)據(jù)表。該他們之間的關(guān)系將在這里解釋。 具體E-R的設(shè)計(jì)處于(圖3)。3.3 在線購(gòu)物系統(tǒng)的結(jié)構(gòu)設(shè)計(jì)在本文中,系統(tǒng)使用基于MVC的Struts,這為開發(fā)人員做出了很大的便利模塊化開發(fā)。 它大大增加了代碼的可重用性和可維護(hù)性,也采取跨平臺(tái)化考慮到這個(gè)系統(tǒng)。 圖。 (4)顯示這個(gè)在線購(gòu)物系統(tǒng)的設(shè)計(jì)模式。視圖負(fù)責(zé)系統(tǒng)的視覺主題和實(shí)現(xiàn)和View由JSP和Action Form組成豆。 JSP包含靜態(tài)HTML,CSS,Div和Struts標(biāo)簽數(shù)據(jù)庫(kù)。 Action Form bean負(fù)責(zé)數(shù)據(jù)JSP和Model之間的傳輸??刂破饔葾ction Servlet組成。 其任務(wù)是:首先,它必須完成所有初始化的工作,即讀取Struts-config中的信息。 xml并攔截匹配Action Servlet的URL地圖; 第二,根據(jù)攔截請(qǐng)求啟動(dòng)Action Form bean; 最后找到Action Mapping中的相應(yīng)Action子類:i沒有相應(yīng)的Action,然后發(fā)送請(qǐng)求到JSP;如果有相應(yīng)的Action,則啟動(dòng)ActionFormbean并使用HTTP填充數(shù)據(jù)及其屬性,并保存這些結(jié)果請(qǐng)求其他Action或JSP使用。在模型4中,具體業(yè)務(wù)邏輯運(yùn)算由Action完成。為了
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 【正版授權(quán)】 ISO/TR 24107:2024 EN Air quality - Validation of air quality measurement methods in the standardization process
- 【正版授權(quán)】 ISO 8000-115:2024 EN Data quality - Part 115: Master data: Exchange of quality identifiers: Syntactic,semantic and resolution requirements
- 2025年度地坪工程環(huán)保驗(yàn)收服務(wù)承包合同樣本
- 2025年度汽車貸款擔(dān)保合同會(huì)計(jì)處理與風(fēng)險(xiǎn)控制要點(diǎn)
- 2025年度法制副校長(zhǎng)履職評(píng)價(jià)及激勵(lì)措施合同
- 2025年度老舊城區(qū)拆除工程承包合同范本
- 2025感恩廣場(chǎng)二期商鋪投資合作協(xié)議
- 2025年白喉、百日咳、破傷風(fēng)、乙肝四聯(lián)制劑項(xiàng)目發(fā)展計(jì)劃
- 文化機(jī)構(gòu)安全隱患排查與防范計(jì)劃
- 讓孩子們愛上數(shù)學(xué)的活動(dòng)安排計(jì)劃
- 建筑材料案例分析
- 2021年新大象版四年級(jí)科學(xué)下冊(cè)全冊(cè)教案(附板書設(shè)計(jì)、教學(xué)反思、總結(jié)點(diǎn)評(píng))
- 小班《夏天的服裝》
- PI形式發(fā)票范文模板
- 城市地理學(xué)第二章城鄉(xiāng)劃分和城市地域
- 中華人民共和國(guó)政府信息公開條例解讀PPT
- 《陳列展覽項(xiàng)目支出預(yù)算方案編制規(guī)范和預(yù)算編制標(biāo)準(zhǔn)試行辦法》的通知(財(cái)辦預(yù)〔2017〕56號(hào))
- 《質(zhì)量手冊(cè)》培訓(xùn)教材課件
- 2016年輸電線路評(píng)價(jià)與分析報(bào)告
- 全名校初二物理期末沖刺30題:力與運(yùn)動(dòng)、壓強(qiáng)和浮力
- 因公出國(guó)(境)管理辦法
評(píng)論
0/150
提交評(píng)論