外文翻译----Servlet和JSP技术简述外文翻译----Servlet和JSP技术简述

阳光彩票平台 www.luanucci.com 宽屏显示 收藏 分享

阳光彩票预览需要最新版本的Flash Player支持。
您尚未安装或版本过低,建议您

中文3727字,2190单词AnOverviewofServletandJSPTechnologyGildasAvoineandPhilippeOechslinEPFL,Lausanne,Switzerland1.1AServletsJobServletsareJavaprogramsthatrunonWeborapplicationservers,actingasamiddlelayerbetweenrequestscomingfromWebbrowsersorotherHTTPclientsanddatabasesorapplicationsontheHTTPserver.Theirjobistoperformthefollowingtasks,asillustratedinFigure11.Figure111.Readtheexplicitdatasentbytheclient.TheendusernormallyentersthisdatainanHTMLformonaWebpage.However,thedatacouldalsocomefromanappletoracustomHTTPclientprogram.2.ReadtheimplicitHTTPrequestdatasentbythebrowser.Figure11showsasinglearrowgoingfromtheclienttotheWebserverthelayerwhereservletsandJSPexecute,buttherearereallytwovarietiesofdatatheexplicitdatathattheenduserentersinaformandthebehindthescenesHTTPinformation.Bothvarietiesarecritical.TheHTTPinformationincludescookies,informationaboutmediatypesandcompressionschemesthebrowserunderstands,andsoon.3.Generatetheresults.Thisprocessmayrequiretalkingtoadatabase,executinganRMIorEJBcall,invokingaWebservice,orcomputingtheresponsedirectly.Yourrealdatamaybeinarelationaldatabase.Fine.ButyourdatabaseprobablydoesntspeakHTTPorreturnresultsinHTML,sotheWebbrowsercanttalkdirectlytothedatabase.Evenifitcould,forsecurityreasons,youprobablywouldnotwantitto.Thesameargumentappliestomostotherapplications.YouneedtheWebmiddlelayertoextracttheincomingdatafromtheHTTPstream,talktotheapplication,andembedtheresultsinsideadocument.4.Sendtheexplicitdatai.e.,thedocumenttotheclient.Thisdocumentcanbesentinavarietyofformats,includingtextHTMLorXML,binaryGIFimages,orevenacompressedformatlikegzipthatislayeredontopofsomeotherunderlyingformat.But,HTMLisbyfarthemostcommonformat,soanimportantservlet/JSPtaskistowraptheresultsinsideofHTML.5.SendtheimplicitHTTPresponsedata.Figure11showsasinglearrowgoingfromtheWebmiddlelayertheservletorJSPpagetotheclient.But,therearereallytwovarietiesofdatasentthedocumentitselfandthebehindthescenesHTTPinformation.Again,bothvarietiesarecriticaltoeffectivedevelopment.SendingHTTPresponsedatainvolvestellingthebrowserorotherclientwhattypeofdocumentisbeingreturnede.g.,HTML,settingcookiesandcachingparameters,andothersuchtasks.1.2WhyBuildWebPagesDynamicallymanyclientrequestscanbesatisfiedbyprebuiltdocuments,andtheserverwouldhandletheserequestswithoutinvokingservlets.Inmanycases,however,astaticresultisnotsufficient,andapageneedstobegeneratedforeachrequest.ThereareanumberofreasonswhyWebpagesneedtobebuiltonthefly1.TheWebpageisbasedondatasentbytheclient.Forinstance,theresultspagefromsearchenginesandorderconfirmationpagesatonlinestoresarespecifictoparticularuserrequests.Youdontknowwhattodisplayuntilyoureadthedatathattheusersubmits.Justrememberthattheusersubmitstwokindsofdataexpliciti.e.,HTMLformdataandimpliciti.e.,HTTPrequestheaders.Eitherkindofinputcanbeusedtobuildtheoutputpage.Inparticular,itisquitecommontobuildauserspecificpagebasedonacookievalue.2.TheWebpageisderivedfromdatathatchangesfrequently.Ifthepagechangesforeveryrequest,thenyoucertainlyneedtobuildtheresponseatrequesttime.Ifitchangesonlyperiodically,however,youcoulddoittwowaysyoucouldperiodicallybuildanewWebpageontheserverindependentlyofclientrequests,oryoucouldwaitandonlybuildthepagewhentheuserrequestsit.Therightapproachdependsonthesituation,butsometimesitismoreconvenienttodothelatterwaitfortheuserrequest.Forexample,aweatherreportornewsheadlinessitemightbuildthepagesdynamically,perhapsreturningapreviouslybuiltpageifthatpageisstilluptodate.3.TheWebpageusesinformationfromcorporatedatabasesorotherserversidesources.Iftheinformationisinadatabase,youneedserversideprocessingeveniftheclientisusingdynamicWebcontentsuchasanapplet.ImagineusinganappletbyitselfforasearchenginesiteDownloading50terabyteapplet,pleasewaitObviously,thatissillyyouneedtotalktothedatabase.GoingfromtheclienttotheWebtiertothedatabaseathreetierapproachinsteadoffromanappletdirectlytoadatabaseatwotierapproachprovidesincreasedflexibilityandsecuritywithlittleornoperformancepenalty.Afterall,thedatabasecallisusuallytheratelimitingstep,sogoingthroughtheWebserverdoesnotslowthingsdown.Infact,athreetierapproachisoftenfasterbecausethemiddletiercanperformcachingandconnectionpooling.Inprinciple,servletsarenotrestrictedtoWeborapplicationserversthathandleHTTPrequestsbutcanbeusedforothertypesofserversaswell.Forexample,servletscouldbeembeddedinFTPormailserverstoextendtheirfunctionality.And,aservletAPIforSIPSessionInitiationProtocolserverswasrecentlystandardizedseehttp//jcp.org/en/jsr/detailid116.Inpractice,however,thisuseofservletshasnotcaughton,andwellonlybediscussingHTTPservlets.1.3TheAdvantagesofServletsOverTraditionalCGIJavaservletsaremoreefficient,easiertouse,morepowerful,moreportable,safer,
编号:201404031413340514    大?。?span class="font-tahoma">254.00KB    格式:DOC    上传时间:2014-04-03
  
100
金币
关 键 词:
外文 翻译 servlet 以及 jsp 技术 简述
  毕设资料网所有阳光彩票均是用户自行上传分享,未经上传用户书面授权,请勿作他用。
0条评论

还可以输入200字符

暂无评论,赶快抢占沙发吧。

关于本文
本文标题:外文翻译----Servlet和JSP技术简述
链接地址:http://www.luanucci.com/p-130514.html
关于我们 - 网站声明 - 网站地图 - 阳光彩票地图 - 友情链接 - 网站客服客服 - 联系我们
copyright@ 2008-2020 阳光彩票平台版权所有
本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
举报电话:13982715227 举报邮箱:540560583@qq.com 网站备案号: 蜀ICP备14003304号-1
阳光彩票平台

川公网安备 51050302000003号