計算機(jī)科學(xué)與技術(shù)外文翻譯、中英對照、英漢互譯_第1頁
計算機(jī)科學(xué)與技術(shù)外文翻譯、中英對照、英漢互譯_第2頁
計算機(jī)科學(xué)與技術(shù)外文翻譯、中英對照、英漢互譯_第3頁
計算機(jī)科學(xué)與技術(shù)外文翻譯、中英對照、英漢互譯_第4頁
計算機(jī)科學(xué)與技術(shù)外文翻譯、中英對照、英漢互譯_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、畢業(yè)設(shè)計(論文)外文資料翻譯學(xué)院(系): 計算機(jī)科學(xué)與技術(shù)學(xué)院 專 業(yè): 計算機(jī)科學(xué)與技術(shù) 姓 名: 學(xué) 號: (用外文寫)外文出處: A Development Frame Application Based on the Hibernate、 the Struts and the Spring J2EE 附 件: 1.外文資料翻譯譯文;2.外文原文。指導(dǎo)教師評語: 簽名: 年 月 日附件1:外文資料翻譯譯文隨著Java技術(shù)的逐漸成熟與完善,作為建立企業(yè)級應(yīng)用的標(biāo)準(zhǔn)平臺,J2EE平臺得到了長足的發(fā)展。借助于J2EE規(guī)范中包含的多項(xiàng)技術(shù):Enterprise JavaBean(EJB)、Jav

2、a Servlets(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的重量級框架,這種框架適合于開發(fā)大型企業(yè)應(yīng)用,但是使用EJB容器進(jìn)行開發(fā)和調(diào)試需要耗費(fèi)大量時間。為了降低代碼的耦合性,提高系統(tǒng)的開發(fā)效率,本

3、文提出了一種基于Struts框架、Hibernate框架和Spring框架的J2EE應(yīng)用開發(fā)策略。Hibernate 框架Hibernate是一個數(shù)據(jù)持久層框架,是一種實(shí)現(xiàn)對象和關(guān)系之間映射(O/R Mapping)的工具,它對JDBC進(jìn)行了輕量級的對象封裝,使程序員可以使用對象編程思想來操作數(shù)據(jù)庫。它不僅提供了從Java類到數(shù)據(jù)表的映射,也提供了數(shù)據(jù)查詢和恢復(fù)機(jī)制。相對于使用JDBC和SQL來操作數(shù)據(jù)庫,使用Hibernate能大大的提高實(shí)現(xiàn)的效率。Hibernate框架用配置文件的形式來定義Java對象和數(shù)據(jù)表之間的映射關(guān)系,同時在更深的層面將數(shù)據(jù)表之間的關(guān)系解釋為Java對象之間的繼承及

4、包含等關(guān)系。通過使用HQL語句將復(fù)雜的關(guān)系算法用對象的方式描述,在很大程度上簡化了對數(shù)據(jù)的查詢,加快了開發(fā)的效率。在Hibernate中有一個簡單而直觀的API,用于對數(shù)據(jù)庫所表示的對象執(zhí)行查詢。要創(chuàng)建或修改這些對象,只需在程序中與它們進(jìn)行交互,然后告訴Hibernate保存即可。這樣,大量封裝持久化操作的業(yè)務(wù)邏輯不再需要編寫煩瑣的JDBC語句,從而使數(shù)據(jù)持久層得到了極大的簡化。 用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è)計可變性

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

6、應(yīng)一個控制器。模型、視圖與控制器的分離,使得一個模型可以具有多個顯示視圖。如果用戶通過某個視圖的控制器改變了模型的數(shù)據(jù),所有其它依賴于這些數(shù)據(jù)的視圖都應(yīng)反映到這些變化。因此,無論何時發(fā)生了何種數(shù)據(jù)變化,控制器都會將變化通知所有的視圖,導(dǎo)致顯示的更新。這實(shí)際上是一種模型的變化-傳播機(jī)制。 Struts框架Struts框架最早是作為Apache Jakarta項(xiàng)目的組成部分問世運(yùn)做,它繼承了MVC的各項(xiàng)特性,并根據(jù)J2EE的特點(diǎn),做了相應(yīng)的變化與擴(kuò)展。Struts框架很好的結(jié)合了Jsp,Java Servlet,Java Bean,Taglib等技術(shù)。在Struts中,承擔(dān)MVC中控制器角色的是A

7、ctionServlet。ActionServlet是一個通用的控制組件。這個控制組件提供了處理所有發(fā)送到Struts的HTTP請求的入口點(diǎn),它截取和分發(fā)這些請求到相應(yīng)的動作類(這些動作類都是Action類的子類)。另外控制組件也負(fù)責(zé)用相應(yīng)的請求參數(shù)填充Action Form(FromBean),并傳給動作類(ActionBean)。動作類訪問核心商業(yè)邏輯,即訪問Java Bean或調(diào)用EJB。最后動作類把控制權(quán)傳給后續(xù)的JSP文件,由JSP文件生成視圖。所有這些控制邏輯利用Struts-config.xml文件來配置。在Struts框架中,視圖主要由JSP生成頁面完成,Struts提供豐富的

8、JSP標(biāo)簽庫,這有利于分開表現(xiàn)邏輯和程序邏輯。模型以一個或多個Java Bean的形式存在。在Struts中,主要存在三種Bean,分別是:Action,ActionForm,EJB或者Java Bean。 Struts框架沒有具體定義模型層的實(shí)現(xiàn),在實(shí)際開發(fā)中,模型層通常是和業(yè)務(wù)邏輯緊密相連的,并且要對底層數(shù)據(jù)進(jìn)行操作。下面介紹一種開發(fā)策略,將Hibernate引入到Struts框架的模型層中,使用它來進(jìn)行數(shù)據(jù)封裝和映射,提供持久化的支持。Spring 框架Spring明顯區(qū)別于其他輕量級application framework, 它將專注于web的支持,與struts 和 webwork

9、有著明顯的區(qū)別。 在與struts、webwork的對比上,Spring是一個服務(wù)于所有層面的application framework:提供了bean的配置基礎(chǔ),AOP的支持,JDBC的提取框架,抽象事務(wù)支持等等。它有一個非常顯著的特點(diǎn):在某個層面上如果你不需要Spring的支持,你就可以不使用Spring的class,只使用它的某一部分的功能。 從它的設(shè)計理念,你可以看到Spring 幫助你實(shí)現(xiàn)了真正的邏輯層和web層的分離。例如:一個校驗(yàn)應(yīng)用將不用依靠controllers就可以實(shí)現(xiàn)。這樣的目標(biāo)更好的重用和易測,過分依靠不必要的容器和框架將不能實(shí)現(xiàn)這一點(diǎn)。當(dāng)然,Spring 有自己的we

10、b支持和通常框架模式細(xì)致完整。然而,Spring替換struts、webwork或者其他的web方案非常容易。對于Spring的web支持或者不同的地方,Spring 允許你在web容器里面建立一個中間層,在測試環(huán)境或者標(biāo)準(zhǔn)獨(dú)立的應(yīng)用里面來設(shè)置重用你的商務(wù)邏輯.還有在J2EE環(huán)境里面,你的商務(wù)邏輯不必依靠容器提供的服務(wù),像JTA ,EJB的支持。良好的構(gòu)架的web應(yīng)用可以運(yùn)行在任何容器上,如,Tomcat 或者 Resin。值得注意的是,Spring 不是和已經(jīng)存在的解決方案進(jìn)行競爭. 我們鼓勵結(jié)合標(biāo)準(zhǔn)的技術(shù),如,Servlet,JSP, JTA,JNDI,JDBCand JDO和非常匹配的工

11、具,如,Hibernate, Velocity, Log4J, and Cauchos Hessian/Burlap。這個框架的的設(shè)計思想是在你的應(yīng)用需要改良的時候,你將會做一些技術(shù)的選擇,例如,如果你需要分布式事務(wù)處理,你可能需要用Spring的Jta TransactionManager 來實(shí)現(xiàn)JTA服務(wù)。或者用DataSource TransactionManager or HibernateTransactionManager 來實(shí)現(xiàn)的單個數(shù)據(jù)庫交換。Spring 框架通過配置操作mappings,展示resolution,本地化和模版集成圍繞著分派請求操作的servlet-Dispa

12、tcherServlet設(shè)計的。缺省的操作是一個非常簡單的控制接口, 他只提供了ModelAndView handleRequest (request, response)方法。這將用于一個應(yīng)用的控制,但是,如果你想包含多個層次的控制,AbstractController,AbstractCommandController, MultiActionController,SimpleFormController,AbstractWizardFormController。注意,你可以選擇一個適當(dāng)?shù)幕?如果你沒有web form,你就不必用FormController,這就是和Struts最大的不

13、同。你可以通過命令或者form對象來操作任何對象,這不需要接口工具或者一個基礎(chǔ)類的驅(qū)動。Spring的數(shù)據(jù)綁定非常靈活。舉例來說,它描述了具有在應(yīng)用范圍內(nèi)的校驗(yàn)錯誤的輸入機(jī)制,但不是系統(tǒng)錯誤,所以在你的form對象里面你不必復(fù)制你的業(yè)務(wù)對象的spring屬性,只操作出錯的子任務(wù),或者適當(dāng)?shù)剞D(zhuǎn)換spring。換句話說,它通??梢院芎玫闹苯咏壎愕臉I(yè)務(wù)對象。 這也是和struts圍繞請求基礎(chǔ)類Action 和 ActionForm (每個action操作類型) 建立主要的不同之一。對比WebWork,Sping更多的區(qū)別在于對象角色:Spring支持控制器的感念,一個操作命令或者form對象和得到

14、數(shù)據(jù)傳遞給視圖的模式,這個模式通常包含命令和form對象,但有時也包含任意的參考數(shù)據(jù)。換句話說,一個WebWork Action聯(lián)合所有這些角色到一個單獨(dú)的對象。WebWork允許你用已經(jīng)存在的業(yè)務(wù)對象作為你form的一部分,但是只生成各自Action 的bean屬性。最后,操作請求的Action 實(shí)例在一個視圖里面獲得付值和form population。然而,參考數(shù)據(jù)也需要作為Action 的屬性被模擬。關(guān)于視圖:Spring的視圖方案非常的靈活。一個控制器執(zhí)行可以通過response 返回ModelAndView對象null就可以直接寫到一個視圖里,在一般情況下,一個ModelAndVi

15、ew實(shí)例結(jié)合了一個view和一個model Map,包含了bean name 和通訊對象(像命令或者form,參考數(shù)據(jù)等等)。View名稱是非常高端的配置,不是通過bean name,一個properties 文件就是通過你自己的ViewResolver.這個抽象的model Map 允許你在視圖層面完成提取,沒有任何的爭辯JSP/Velocity或者其他,每一種都可以直接完整使用.這個model Map 還可以簡單得得到適當(dāng)?shù)母袷交瘮?shù)據(jù)的轉(zhuǎn)換,像JSP 請求屬性或者Velocity 模版模式. 如果你不想用Spring的 web MVC,但是想借用Spring嫁接其他的解決方案,你可以非常簡

16、單地通過Spring繼承你自己的web 框架,你可以非常簡單地通過ContextLoaderListener啟動一個Spring root application context,并且,通過Struts 或者WebWork 的action 利用ServletContext 屬性(或者Spring 的helper方法)存取它。值得注意的是, 這里沒有任何的plugins被調(diào)用,因此沒有專門的集成:來自web層的視圖, 你可以簡單的將Spring作為一個管理application context 實(shí)例入口點(diǎn)的類庫。所有你注冊bean和Spring服務(wù)都可以在不需要Spring的web MVC的情況

17、下都可以輕松掌握。Spring不是和Struts 、WebWork這些應(yīng)用進(jìn)行競爭,它將作為一個純web框架應(yīng)用于很多領(lǐng)域,因?yàn)樗恍枰渲脭?shù)據(jù)存儲和事務(wù)操作,所以,你可以利用Spring提供的中間層和數(shù)據(jù)存儲層來豐富你的應(yīng)用,甚至用JDBC或者Hibernate進(jìn)行事務(wù)抽象。如果僅僅聚焦于web支持,Spring的一些顯著特點(diǎn)是清楚分離:controller,validator,command object,form object,model object,和 DispatcherServlet,handler mapping vs view resolver等等強(qiáng)大而且直接的框架和作為Ja

18、vaBeans的應(yīng)用配置,包括簡單的參照和應(yīng)用內(nèi)容,例如,從web控制器到業(yè)務(wù)對象和數(shù)據(jù)校驗(yàn)。適應(yīng)性,無論什么樣的控制器你都需要得到代替Action/ActionForm所做的每件事情的方案(簡單,命令,form,范例,多重action,或者定制一個) 重用業(yè)務(wù)邏輯代碼,不需要復(fù)制,你可以用已經(jīng)有的業(yè)務(wù)邏輯對象作為命令或則form對象代替反射特定的ActionForm子類??捎喼频慕壎ê蛿?shù)據(jù)校驗(yàn)作為應(yīng)用級的輸入機(jī)制的錯誤校驗(yàn),固定日期和數(shù)字綁定,例如,通過手動檢查和轉(zhuǎn)換業(yè)務(wù)對象來替換單個的string??捎喼频牟僮?可訂制的視圖方案:通過name/value Map靈活的模型傳送,用一個簡單的

19、方法從簡單到復(fù)雜操作映射和視圖方案策略。以在J2EE應(yīng)用中非常普遍的用戶登錄過程為例來說明上述體系結(jié)構(gòu)是如何具體運(yùn)用的。登錄的流程非常清晰:用戶從登錄頁面login.jsp輸入登錄信息,系統(tǒng)對登錄信息進(jìn)行驗(yàn)證,如果正確則成功登錄,否則提示相應(yīng)錯誤信息。在開發(fā)過程中,使用Eclipse做為開發(fā)環(huán)境,同時加載了對Struts、Spring及Hibernate提供更好的控制和支持的第三方插件MyEclipse,Web服務(wù)器使用Tomcat,數(shù)據(jù)庫選用了Mysql。首先對Hibernate進(jìn)行配置,只需要對系統(tǒng)自動生成的hibernate.cfg.xml進(jìn)行修改,配置好數(shù)據(jù)庫連接的各種參數(shù)以及定義數(shù)據(jù)

20、映射文件。由于Hibernate所帶的連接池主要用于測試,性能不是很好,可以通過JNDI將其修改為使用Tomcat的連接池。附件2:外文原文(復(fù)印件)A Development Frame Application Based on the Hibernate、the Struts and the Spring J2EEOne preface along with the Java technique of gradual mature and perfect. Be establishment business enterprise class application of standard

21、terrace,the J2 EE terrace got substantial of development .Several technique asked for help from to include in the J2 EE norm : Enterprise JavaBean (EJB), Java Servlets (Servlet), Java Server Pages(JSP), Java Message Service(JMS)etc., development many application system.But, also appeared some proble

22、m in the tradition J2 the EE the application of the development the process:1)the antinomy of of data model and logic model. Currently the database of usage basically and all is relation type database, but the Java be essentially a kind of the language which face to object, object at saving with rea

23、d usage SQL and JDBC carry on a database operation and lowered plait distance of efficiency and system of can maintenance;2)tradition of J2 EE application much the adoption is according to the EJB heavy weight frame, this kind of frame suitable for develop a large business enterprise application, bu

24、t usage the EJB container carry on development and adjust to try to need to be waste a great deal of time.For lowering the Ou of code to match sex, exaltation system of development efficiency, this text put forward one kind EE according to the J2 of the Struts frame 、the Hibernate frame and the Spri

25、ng frame application development strategy. The Hibernate FrameDatas holding out for long time layer and Hibernate is one piece according to hold out for long time layer frame, is a kind of realization object and relation of the tool which reflect to shoot(O/R Mapping), it carried on the object of th

26、e lightweight to pack to the JDBC and make procedure member can usage object plait distance thought to operation database. It not only provided to shoot from Java to reflect of data form, but also provided a data a search and instauration mechanism. Opposite in usage JDBC and SQL to operation databa

27、se, use Hibernate ability consumedly of exaltation realization of efficiency. The Hibernate frame use allocation document of the form come to the reflect of the definition Java object and data form to shoot relation, in the meantime at more deep of level of data form of relation explanation for the

28、relations such as inherit of and containment etc. of Java object. Pass the usage HQL language sentence complications of relation the calculate way use the way of object description, to a large extent simplification logarithms according to of search, speed development of efficiency. Have in the Hiber

29、nate a simple but keep the API of view, used for to the database mean of object performance search. Want to establish or the modification be these objects, need in the procedure carry on with them to hand over with each other, then tell Hibernate to keep. So, a great deal of pack hold out for long t

30、ime turn operation of business logic no longer demand write a trivial JDBC language sentence, make data last long thus the layer got biggest of simplification. Use the Struts realization MVC structure MVC(Model-View-Controller) is put forward by the Trygve Reenskaug, first drive application in the e

31、nvironment SmallTalk-80, is many to hand over with each other with interface system of constitute foundation. According to the need of variable of the interface design, MVC hand over with each other constitute of system to resolve into model and see diagram, controller three part. Model(Model) is so

32、ftware processing problem logic at independence in outside manifestation under contents and form circumstance of inside abstract, packed the core data, logic of problem and function of calculation relation, independence in concrete of interface expression and I/O operation. See diagram(View) mean in

33、formation and particular form demonstration of model data and logic relation and appearance to the customer. It acquire a manifestation information from the model, there can be many for homology of information dissimilarity of manifestation form or see diagram. The controller(Controller) is a proces

34、sing the customer hand over with software with each other operation of, its job is control provide model in any variety of dissemination, insure a customer interface among the model of rightness should contact; It accept a customer of importation, give the importation feedback model, then realizatio

35、n compute model control, is make model and see diagram to moderate work of parts. Usually 1 see a diagram rightness should a controller. Model, see separate of diagram and controller, make a model be able to have many manifestation to see diagram. If the customer pass a certain see the controller of

36、 diagram change the data of model, all other dependence in these see of data diagram all should reflection arrive these variety. When therefore and regardless occurrence what data variety, controller all would variety notice ally see diagram, cause manifestation of renewal. This is actually a kind o

37、f variety of model-dissemination mechanism. The Struts FrameThe Struts frame is to be the item of Apache Jakarta to constitute part to publish luck to do at the earliest stage, it inherited MVC of each item characteristic, and did according to the characteristics of J2 EE correspond of variety with

38、expand. The Struts frame was good to combine Jsp , Java Servlet , Java Bean, Talia etc. technique. In the Struts, what to undertake the controller role in the MVC be an ActionServlet. The ActionServlet is an in general use control module. This control module provided a processing all HTTP claim whic

39、h send out Struts of entrance point. Its interception with distribute these claim to arrive correspond of action type.(these action all of type is Action son type)Moreover the control module is also responsible for using to correspond of claim the parameter fill Action Form(FromBean), and pass actio

40、n type(ActionBean).Action type the business logic of the interview core, then interview Java Bean or adjust to use EJB. End action type control the power pass follow-up of JSP document, from JSP document born see diagram. All these control logic make use of Struts-config.xml the document come to all

41、ocation. See diagram in the Struts frame main from JSP born page completion, the Struts provide abundant of JSP label database, this is advantageous to separating performance logic and procedure logic.The model is with 1 or the form existence of several Java Bean. In the Struts, main existence three

42、 kinds of Bean, respectively BE: Action, ActionForm, EJB perhaps Java Bean. The Struts frame have no concrete definition model layer of realization, in actually the development, model layer usually is close with business logic connect with each other, and want to carry on operation to the first floo

43、r data. The underneaths introduction is a kind of development strategy, lead the Hibernate into the model layer of Struts frame, usage it to carry on a data to pack with reflect to shoot, provide hold out for long time turn of support. 4 usage Hibernate and the Struts development J2 EE application 4

44、.1 system structure diagram 3 manifestation according to Hibernate and Struts development strategy of system structure diagram. the Spring FrameSpring isnt particularly a web framework but a generic lightweight application framework with dedicated web support, and show the architectural differences

45、to Struts and WebWorkIn contrast to Struts or WebWork, Spring is an application framework for all layers: It offers a bean configuration foundation, AOP support, JDBC abstraction framework, abstract transaction support etc. It is a very non-intrusive effort: Your application classes do not need to d

46、epend on any Spring classes if not necessary, and you can reuse every part on its own if you like to. From its very design, the framework encourages clean separation of tiers, most importantly web tier and business logic. e.g: the validation framework does not depend on web controllers. Major goals

47、are reusability and testability: Unnecessary container or framework dependencies can be considered avoidable evils.Of course, Springs own web support is nicely integrated with the frameworks general patterns. Nevertheless, replacing the web solution with Struts, WebWork, or the like is easy. Both wi

48、th Springs web support or a different one, Spring allows for building a true dedicated middle tier in the web container, with the option to reuse exactly the same business logic in test environments or standalone applications. And within J2EE, your business logic will not unnecessarily depend on con

49、tainer services like JTA or EJB - allowing complex, well-architected web applications to run in a simple container like Tomcat or Resin.Note that Spring doesnt generally aim to compete with existing solutions. It rather fosters seamless integration with standards like Servlet, JSP, JTA, JNDI, JDBC,

50、and JDO, and well-suited tools like Hibernate, Velocity, Log4J, and Cauchos Hessian/Burlap. The framework is designed to grow with the needs of your applications, in terms of technology choice: For example, you will probably use JTA via Springs JtaTransactionManager if you need distributed transacti

51、ons - but only then, as there are perfect replacements for single databases, like DataSourceTransactionManager or HibernateTransactionManager.Springs web framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, and lo

52、cale and theme resolution. The default handler is a very simple Controller interface, just offering a ModelAndView handleRequest(request,response) method. This can already be used for application controllers, but you will prefer the included implementation hierarchy, consisting of AbstractController

53、, AbstractCommandController, MultiActionController, SimpleFormController, AbstractWizardFormController. Application controllers will typically be subclasses of those. Note that you can choose an appropriate base class: If you dont have a form, you dont need a FormController. This is a major differen

54、ce to Struts.You can take any object as command or form object: Theres no need to implement an interface or derive from a base class. Springs data binding is highly flexible, e.g. it treats type mismatches as validation errors that can be evaluated by the application, not as system errors. So you do

55、nt need to duplicate your business objects properties as Strings in your form objects, just to be able to handle invalid submissions, or to convert the Strings properly. Instead, its often preferable to bind directly to your business objects. This is another major difference to Struts which is built

56、 around required base classes like Action and ActionForm - for every type of action. Compared to WebWork, Spring has more differentiated object roles: It supports the notion of a Controller, an optional command or form object, and a model that gets passed to the view. The model will normally include

57、 the command or form object but also arbitrary reference data. Instead, a WebWork Action combines all those roles into one single object. WebWork does allow you to use existing business objects as part of your form, but just by making them bean properties of the respective Action class. Finally, the

58、 same Action instance that handles the request gets used for evaluation and form population in the view. Thus, reference data needs to be modelled as bean properties of the Action too. Regarding views: Springs view resolution is extremely flexible. A Controller implementation can even write a view directly to the response, returning null as ModelAndView. In the normal case, a ModelAndView instance consists of a view name and a model Map, containing bean names and corresponding objects (like a command or form, reference data, etc). View name resolution is h

溫馨提示

  • 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. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(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

提交評論