资源描述:
《计算机论文文献翻译》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、上海应用技术学院毕业设计(论文)第-20-页附录A外文原文Struts——anopen-sourceMVCimplementationMalcolmDavisThisarticleintroducesStruts,aModel-View-ControllerimplementationthatusesservletsandJavaServerPages(JSP)technology.StrutscanhelpyoucontrolchangeinyourWebprojectandpromotespecialization.Evenifyouneverimplementasyste
2、mwithStruts,youmaygetsomeideasforyourfutureservletsandJSPpageimplementation.IntroductionKidsingradeschoolputHTMLpagesontheInternet.However,thereisamonumentaldifferencebetweenagradeschoolpageandaprofessionallydevelopedWebsite.Thepagedesigner(orHTMLdeveloper)mustunderstandcolors,thecustomer,pr
3、oductflow,pagelayout,browsercompatibility,imagecreation,JavaScript,andmore.Puttingagreatlookingsitetogethertakesalotofwork,andmostJavadevelopersaremoreinterestedincreatingagreatlookingobjectinterfacethanauserinterface.JavaServerPages(JSP)technologyprovidesthegluebetweenthepagedesignerandtheJ
4、avadeveloper.Ifyouhaveworkedonalarge-scaleWebapplication,youunderstandthetermchange.Model-View-Controller(MVC)isadesignpatternputtogethertohelpcontrolchange.MVCdecouplesinterfacefrombusinesslogicanddata.StrutsisanMVCimplementationthatusesServlets2.2andJSP1.1tags,fromtheJ2EEspecifications,asp
5、artoftheimplementation.YoumayneverimplementasystemwithStruts,butlookingatStrutsmaygiveyousomeideasonyourfutureServletsandJSPimplementations.Model-View-Controller(MVC)JSPtagssolvedonlypartofourproblem.Westillhaveissueswithvalidation,flowcontrol,andupdatingthestateoftheapplication.ThisiswhereM
6、VCcomestotherescue.MVChelpsresolvesomeoftheissueswiththesinglemoduleapproachbydividingtheproblemintothreecategories:·ModelThemodelcontainsthecoreoftheapplication'sfunctionality.Themodel上海应用技术学院毕业设计(论文)第-20-页encapsulatesthestateoftheapplication.Sometimestheonlyfunctionalityitcontainsisstate.I
7、tknowsnothingaboutthevieworcontroller.·ViewTheviewprovidesthepresentationofthemodel.Itisthelookoftheapplication.Theviewcanaccessthemodelgetters,butithasnoknowledgeofthesetters.Inaddition,itknowsnothingaboutthecontroller.Theviewshouldbenotifiedwhenc