资源描述:
《关于JAVA技术 毕业论文外文翻译》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、附录一外文资料原文:ABOUTJAVATECHNOLOGYServletsandJSP:AnOverview1.WhatareJavaServlets?ServletsareJavatechnology'sanswertoCGIprogramming.TheyareprogramsthatrunonaWebserverandbuildWebpages.BuildingWebpagesontheflyisuseful(andcommonlydone)foranumberofreasons:·TheW
2、ebpageisbasedondatasubmittedbytheuser.Forexampletheresultspagesfromsearchenginesaregeneratedthisway,andprogramsthatprocessordersfore-commercesitesdothisaswell.·Thedatachangesfrequently.Forexample,aweather-reportornewsheadlinespagemightbuildthepagedyna
3、mically,perhapsreturningapreviouslybuiltpageifitisstilluptodate.·TheWebpageusesinformationfromcorporatedatabasesorothersuchsources.Forexample,youwouldusethisformakingaWebpageatanon-linestorethatlistscurrentpricesandnumberofitemsinstock.2.WhataretheAdv
4、antageofServletsOver"Traditional"CGI?Javaservletsaremoreefficient,easiertouse,morepowerful,moreportable,andcheaperthantraditionalCGIandthanmanyalternativeCGI-liketechnologies.(Moreimportantly,servletdevelopersgetpaidmorethanPerlprogrammers:-).·Efficie
5、nt.WithtraditionalCGI,anewprocessisstartedforeachHTTPrequest.IftheCGIprogramdoesarelativelyfastoperation,theoverheadofstartingtheprocesscandominatetheexecutiontime.Withservlets,theJavaVirtualMachinestaysup,andeachrequestishandledbyalightweightJavathre
6、ad,notaheavyweightoperatingsystemprocess.Similarly,intraditionalCGI,ifthereareNsimultaneousrequesttothesameCGIprogram,thenthecodefortheCGIprogramisloadedintomemoryNtimes.Withservlets,however,thereareNthreadsbutonlyasinglecopyoftheservletclass.Servlets
7、alsohavemorealternativesthandoregularCGIprogramsforoptimizationssuchascachingpreviouscomputations,keepingdatabaseconnectionsopen,andthelike.·Convenient.Hey,youalreadyknowJava.WhylearnPerltoo?Besidestheconvenienceofbeingabletouseafamiliarlanguage,servl
8、etshaveanextensiveinfrastructureforautomaticallyparsinganddecodingHTMLformdata,readingandsettingHTTPheaders,handlingcookies,trackingsessions,andmanyothersuchutilities.·Powerful.Javaservletsletyoueasilydoseveralthingsthataredifficultorimpossibl