2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩6頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、<p>  一種基于Hibernate和Struts的J2EE應(yīng)用開發(fā)策略</p><p>  This text analysis the mechanism of Hibernate and Struts, put forward 1 kind EE according to the J2 of the Hibernate and the Struts application development

2、 strategy.In this kind of strategy, the model layer use a Hibernate realization and see diagram and controller to then use a Struts frame a realization.So can consumedly lower the development efficiency that the Ou of co

3、de match sex and exaltation system. The key word Hibernate, Struts, the MVC, hold out for long time a layer one preface along</p><p>  3 use the Struts realization MVC structure MVC(Model-View-Controller) is

4、 put forward by the Trygve Reenskaug, first drive application in the environment SmallTalk-80, is many to hand over with each other with interface system of constitute foundation.According to the need of variable of the

5、interface design, MVC hand over with each other constitute of system to resolve into model and see diagram, controller three part. Model(Model) is software processing problem logic at independence in outside </p>

6、<p>  The Struts frame is to be the item of Apache Jakarta to constitute part to publish luck to do at the earliest stage, it inheritted MVC of each item characteristic, and did according to the characteristics of J

7、2 EE correspond of variety with expand.The Struts frame was good to combine Jsp, Java Servlet, Java Bean, Taglib etc. technique.In the Struts, what to undertake the controller role in the MVC be an ActionServlet.The Acti

8、onServlet is an in general use control module.This control module provi</p><p>  4.2 Development practice underneath combine a development practice, with in the J2 the EE the application very widespread cust

9、omer register process for example, elucidation above-mentioned system structure is how concrete usage.The process of register is very clear:Customer from register page login.jsp importation register information, system t

10、o register the information carry on verification, if exactitude success register, otherwise hint correspond mistake information. In the development proces</p><p>  本文分析了Hibernate和Struts的機(jī)制,提出了一種基于Hibernate和S

11、truts的J2EE應(yīng)用開發(fā)策略。在這種策略中,模型層用Hibernate實(shí)現(xiàn),視圖和控制器則用Struts框架實(shí)現(xiàn)。這樣可大大降低代碼的耦合性以及提高系統(tǒng)的開發(fā)效率。 關(guān)鍵字 Hibernate,Struts,MVC,持久層 1 引言 隨著Java技術(shù)的逐漸成熟與完善,作為建立企業(yè)級應(yīng)用的標(biāo)準(zhǔn)平臺,J2EE平臺得到了長足的發(fā)展。借助于J2EE規(guī)范中包含的多項(xiàng)技術(shù):Enterprise JavaBean(EJB)、Java Servle

12、ts(Servlet)、Java Server Pages(JSP)、Java Message Service(JMS)等,開發(fā)出了許多應(yīng)用系統(tǒng)。但是,在傳統(tǒng)J2EE應(yīng)用的開發(fā)過程中也出現(xiàn)了一些問題:1)數(shù)據(jù)模型和邏輯模型之間的矛盾。目前使用的數(shù)據(jù)庫基本上都是關(guān)系型數(shù)據(jù)庫,而Java本質(zhì)上是一種面向?qū)ο蟮恼Z言,對象在存儲和讀取時使用SQL和JDBC進(jìn)行數(shù)據(jù)庫操作,降低了編程的效率以及系統(tǒng)的可維護(hù)性;2)傳統(tǒng)的J2EE應(yīng)用多采用基于EJB

13、的重量級框架,這種框架適合于開發(fā)大</p><p>  3 用Struts實(shí)現(xiàn)MVC架構(gòu) MVC(Model-View-Controller)由Trygve Reenskaug提出,首先被應(yīng)用在SmallTalk-80環(huán)境中,是許多交互和界面系統(tǒng)的構(gòu)成基礎(chǔ)。根據(jù)界面設(shè)計可變性的需求,MVC把交互系統(tǒng)的組成分解成模型、視圖、控制器三部分。 模型(Model)是軟件所處理問題邏輯在獨(dú)立于外在顯示內(nèi)容和形式情況下的內(nèi)在

14、抽象,封裝了問題的核心數(shù)據(jù)、邏輯和功能的計算關(guān)系,獨(dú)立于具體的界面表達(dá)和I/O操作。視圖(View)把表示模型數(shù)據(jù)及邏輯關(guān)系和狀態(tài)的信息及特定形式展示給用戶。它從模型獲得顯示信息,對于相同的信息可以有多個不同的顯示形式或視圖。控制器(Controller)是處理用戶與軟件的交互操作的,其職責(zé)是控制提供模型中任何變化的傳播,確保用戶界面于模型間的對應(yīng)聯(lián)系;它接受用戶的輸入,將輸入反饋給模型,進(jìn)而實(shí)現(xiàn)對模型的計算控制,是使模型和視圖協(xié)調(diào)工作

15、的部件。通常一個視圖對應(yīng)一個控制器。模型、視圖與控制器的分離,使得一個模型可以具有多個顯示視圖。如果用戶通過某個視圖的控制器改變了模型的數(shù)據(jù),所有其它依賴于這些數(shù)據(jù)的視圖都應(yīng)反映到這些變化。因此,無論</p><p>  Struts框架最早是作為Apache Jakarta項(xiàng)目的組成部分問世運(yùn)做,它繼承了MVC的各項(xiàng)特性,并根據(jù)J2EE的特點(diǎn),做了相應(yīng)的變化與擴(kuò)展。Struts框架很好的結(jié)合了Jsp,Java

16、Servlet,Java Bean,Taglib等技術(shù)。在Struts中,承擔(dān)MVC中控制器角色的是ActionServlet。ActionServlet是一個通用的控制組件。這個控制組件提供了處理所有發(fā)送到Struts的HTTP請求的入口點(diǎn)。它截取和 分發(fā)這些請求到相應(yīng)的動作類(這些動作類都是Action類的子類)。另外控制組件也負(fù)責(zé)用相應(yīng)的請求參數(shù)填充Action Form(FromBean),并傳給動作類(ActionBean)。

17、動作類訪問核心商業(yè)邏輯,即訪問Java Bean或調(diào)用EJB。最后動作類把控制權(quán)傳給后續(xù)的JSP文件,由JSP文件生成視圖。所有這些控制邏輯利用Struts-config.xml文件來配置。在Struts框架中,視圖主要由JSP生成頁面完成,Struts提供豐富的JSP標(biāo)簽庫,這有利于分開表現(xiàn)邏輯和程序邏輯。模型以一個或多個Java Bean的形式存在。在Stru</p><p>  4.2 開發(fā)實(shí)踐 下面結(jié)合開

18、發(fā)實(shí)踐,以在J2EE應(yīng)用中非常普遍的用戶登錄過程為例,來說明上述體系結(jié)構(gòu)是如何具體運(yùn)用的。登錄的流程非常清晰:用戶從登錄頁面login.jsp輸入登錄信息,系統(tǒng)對登錄信息進(jìn)行驗(yàn)證,如果正確則成功登錄,否則提示相應(yīng)錯誤信息。 在開發(fā)過程中,使用Eclipse做為開發(fā)環(huán)境,同時加載了對Struts及Hibernate提供更好的控制和支持的第三方插件MyEclipse,Web服務(wù)器使用Tomcat,數(shù)據(jù)庫選用了Mysql。 首先對Hibern

溫馨提示

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

評論

0/150

提交評論