欢迎来到天天文库
浏览记录
ID:14850255
大小:142.50 KB
页数:12页
时间:2018-07-30
《信息科学与工程学院毕业设计科技文献翻译》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、信息科学与工程学院毕业设计科技文献翻译《Struts——AnOpen-sourceMVCImplementation》《Struts——一种开源MVC的实现》姓名张三丰学号20140000年级2014级专业计算机科学与技术 指导教师李双双 2018年3月Struts——AnOpen-sourceMVCImplementationThisarticleintroducesStruts,aModel-View-ControllerimplementationthatusesservletsandJa
2、vaServerPages(JSP)technology.StrutscanhelpyoucontrolchangeinyourWebprojectandpromotespecialization.EvenifyouneverimplementasystemwithStruts,youmaygetsomeideasforyourfutureservletsandJSPpageimplementation1.IntroductionIfyouhaveworkedonalarge-scaleWebapp
3、lication,youunderstandthetermchange.Model-View-Controller(MVC)isadesignpatternputtogethertohelpcontrolchange.MVCdecouplesinterfacefrombusinesslogicanddata.StrutsisanMVCimplementationthatusesServlets2.2andJSP1.1tags,fromtheJ2EEspecifications,aspartofthe
4、implementation.YoumayneverimplementasystemwithStruts,butlookingatStrutsmaygiveyousomeideasonyourfutureServletsandJSPimplementations.2.Model-View-Controller(MVC)JSPtagssolvedonlypartofourproblem.Westillhaveissueswithvalidation,flowcontrol,andupdatingthe
5、stateoftheapplication.ThisiswhereMVCcomestotherescue.MVChelpsresolvesomeoftheissueswiththesinglemoduleapproachbydividingtheproblemintothreecategories:ModelThemodelcontainsthecoreoftheapplication'sfunctionality.Themodelencapsulatesthestateoftheapplicati
6、on.Sometimestheonlyfunctionalityitcontainsisstate.Itknowsnothingaboutthevieworcontroller.ViewTheviewprovidesthepresentationofthemodel.Itisthelookoftheapplication.Theviewcanaccessthemodelgetters,butithasnoknowledgeofthesetters.Inaddition,itknowsnothinga
7、boutthecontroller.Theviewshouldbenotifiedwhenchangestothemodeloccur.ControllerThecontrollerreactstotheuserinput.Itcreatesandsetsthemodel.3.StrutsSummary3.1StrutsdetailsDisplayedinFigure1isastripped-downUMLdiagramoftheorg.apache.Struts.actionpackage.Fig
8、ure6showstheminimalrelationshipsamongActionServlet(Controller),ActionForm(FormState),andAction(ModelWrapper).Figure1UMLdiagramoftherelationshipoftheCommand(ActionServlet)totheModel(Action&ActionForm)3.1.1TheActionServletclassLifeisbette
此文档下载收益归作者所有