资源描述:
《外文文献中文翻译Servlet和JSP技术简述》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Servlet和JSP技术简述AnOverviewofServletandJSPTechnologyAbstractServletprogramrunningintheserver-side,dynamicallygeneratedWebpagewiththetraditionalCGIandmanyothersimilarcomparedtoCGItechnology,JavaServletwithamoreefficient,easiertouse,morepowerfulandhasbetterportability,moresavingstoinvest.Keywords:
2、JSPTechnology,Servlet,HTTPserverServletsareJavaprogramsthatrunonWeborapplicationservers,actingasamiddlelayerbetweenrequestscomingfromWebbrowsersorotherHTTPclientsanddatabasesorapplicationsontheHTTPserver.Theirjobistoperformthefollowingtasks.TheendusernormallyentersthisdatainanHTMLformonaWebpag
3、e.However,thedatacouldalsocomefromanappletoracustomHTTPclientprogram.Therearereallytwovarietiesofdata:theexplicitdatathattheenduserentersinaformandthebehind-the-scenesHTTPinformation.Bothvarietiesarecritical.TheHTTPinformationincludescookies,informationaboutmediatypesandcompressionschemesthebr
4、owserunderstands,andsoon.Thisprocessmayrequiretalkingtoadatabase,executinganRMIorEJBcall,inyokingaWebservice,orcomputingtheresponsedirectly.Yourrealdatamaybeinarelationaldatabase.Fine.Butyourdatabaseprobablydoesn'tspeakHTTPorreturnresultsinHTML,sotheWebbrowsercaiVttalkdirectlytothedatabase.Eve
5、nifitcould,forsecurityreasons,youprobablywouldnotwantitto.Thesameargumentappliestomostotherapplications.YouneedtheWebmiddlelayertoextracttheresultsinsideadocument-MDownloading50terabyteapplet,pleasewait!11Obviously,thatissilly;youneedtotalktothedatabase・GoingfromtheclienttotheWebtiertothedatab
6、ase(athree-tierapproach)insteadoffromanappletdirectlytoadatabase(atwo-tierapproach)providesincreasedflexibilityandsecuritywithlittleornoperformancepenalty.Afterall,thedatabasecallisusuallytherate-limitingstep,sogoingthroughtheWebserverdoesnotslowthingsdown.Infact,athree-tierapproachisoftenfast
7、erbecausethemiddletiercanperformcachingandconnectionpooling.Inprinciple,servletsarenotrestrictedtoWeborapplicationserversthathandleHTTPrequestsbutcanbeusedforothertypesofserversaswell.Forexample,servletscouldbeembeddedinFTPormailservers