JSP技术 ---外文文献.docx
《JSP技术 ---外文文献.docx》由会员分享,可在线阅读,更多相关《JSP技术 ---外文文献.docx(8页珍藏版)》请在冰点文库上搜索。
外文文献
JSPTechnologyandServlets
JSPprofile
JSP(JavaServerPages)isinitiatedbySunMicrosystems,Inc.,withmanycompaniestoparticipateintheestablishmentofadynamicwebpagetechnicalstandards.JSPtechnologysomewhatsimilartoASPtechnology,itisinthetraditionalHTMLwebpagedocument(*・htm,*.html)toinserttheJavaprogrammingparagraph(Scriptiet)andJSPtag(tag),thusJSPdocuments(*.jsp).UsingJSPdevelopmentoftheWebapplicationiscrossthatcanrunonLinux,isalsoavailableforotheroperatingsystems.
JSPtechnologytousetheJavaprogramminglanguagepreparedbythecategoryofXMLtagsandscriptlets,toproducedynamicpagespackageprocessinglogic.Pagealsovisitbytagsandsciptletsexistintheservicessideoftheresourcesoflogic.JSPpagelogicandwebpagedesignanddisplayseparation,supportreusablecomponent-baseddesign,Web-basedapplicationdevelopmentisrapidandeasy.
WebserverinthefaceofvisitsJSPpagerequest,thefirstinpiementationoftheproceduresof,andthentogetherwiththeresultsoftheimplementationofJSPdocumentsinHTMLcodewiththereturntothecustomer.InserttheJavaprogrammingoperationofthedatabasecanbereorientedwebsites,inordertoachievetheestablishmentofdynamicpagesneededtofunction.JSPandJavaServlet,isintheimplementationoftheserver,usuallyreturnedtotheclientisanHTMLtext,aslongastheclientbrowserwillbeabletovisit.
JSP1.0specificationofthefinalversionislaunchedinSeptember1999,Decemberhasintroduced1.1specifications.AtpresentrelativelynewisJSP1.2norms,JSP2.0normsofthedrafthasalsobeenintroduced.JSPpagesfromHTMLcodeandJavacodeembeddedinoneoftheconq)onents.
JSscriptlanguagesynopsis
JSisjavascrip,JavascriptisonekindthesciptlanguagewhichcomesbytheNetscapeLiveScrq)tdevelopment,themainpurposeistosolvetheserverterminallanguage,forinstancePerl,carry-overspeedquestion.Atthattimeservedtheendtoneedtocarryontheconfirmationtothedata,becausethenetworkspeedwasquiteslow,onlythen28.8kbps?
theconfirmationstepwaste'stimeweretoomany.ThereforeNetscapebrowserNavigatorhasjoinedJavascipt,hasprovidedthedataconfirmationbasicfunction.
TheJavaScriptofficialnameis"ECMAScript".ThisstandardbyECMAorganizationdevelopmentandmaintenance.ECMA262istheofficialJavaSciptstandard.ThisstandardbasedonJavaScript(Netscape)andJScipt(Microsoft).Netscape(Navigator2.0)BrendanEichhasinventedthislanguage,startedfrom1996,alreadyappearedinallNetscapeandintheMicrosoftbrowser.TheECMA262developmentbeganin1996,in1997July,theECMAgeneralmeetinghasaccq)teditsfirstedition.
Thesciptusesonespecificdescriptivelanguage,restsoncertainformcompilationtobepossibletheexecutiondocument,isalsocalledasgreatorthebatchrundocument.Thesciptusuallymaytransfertemporarilybytheapplicationprocedureandcarryout.Eachkindofsciptpresentwidelyisappliedinthehomepagedesign,becausethesciptnotonlymayreducethehomepagethescaleandraisesthehomepagebrowsingspeed,moreovermayenrichthehomepageperformance,likeanimation,soundandsoon.Citesamostcommonexample,whenweclickinthehomepagetheEmailaddresscantransferOutlookExpressortheFoxmailthiskindofmailsoftwareautomatically,isrealizesthroughthesciptfunction.Alsobecauseofscriptthesecharacteristics,thehumanwhoharborsulteriormotivesbysomeareoftenusing.Forexamplejoinssomedestructioncomputersystem'sorderinthescript,likethisworksastheuserbrowsinghomepage,oncetransfersthiskindofscript,willthencausetheuserthesystemtocomeundertheattack.Thereforetheusershouldactaccordingtovisitshomepagethetrustdegreeselectivesecurityrank,speciallyregardingtheseitselfcontentontheillegalhomepage,donotpermittheusescripteasily.Through"thesafeestablishment95thedialogbox,thechoice"thescript”imderoptioneachkindofestablishmentmaywitheaserealizetosciptbeingforbidandbeginsusing.
JSPandServlets
ThetechnologyofJSPandServletisthemostimportanttechnologywhichuseJava
technologytoexploitrequestofserver,anditisalsothestandardwhichexploitbusinessapplication.Javadevelopersprefertouseitforavarietyofreasons,oneofwhichisalreadyfamiliarwiththeJavalanguageforthedevelopmentofthistechnologyareeasytolearnJavatotheotherisnapreparation,runeverywhere"tobringtheconceptofWebapplications,Toachievea“one-preparedeverywhererealized.nAndmoreimportantly,iffollowedsomeoftheprinc»lesofgooddesign,itcanbesaidofsq)aratingandcontenttocreatehigh-quality,reusable,easytomaintainandmodifytheapplication.Forexanple,ifthedocumentinHTMLembeddedJavacodetoomuch(scipt),willleadthedevelopedapplicationisextremelyconplex,difficulttoread,itisnoteasyreuse,butalsoforfuturemaintenanceandmodificationwillalsocausedifficulties.Infact,CSDNtheJSP/Servletforum,canoftenseesomequestions,thecodeisverylong,canlogicisnotveryclear,alargenumberofHTMLandJavacodemixedtogether.Thisistherandomdevelopmentofthedefects.
EarlydynamicpagesmainlyCGI(CommonGatewayInterface,publicGatewayInterface)technology,youcanusedifferentlanguagesoftheCGIprograms,suehasVB,C/C++orDelphi,andsoon.ThoughthetechnologyofCGIisdevelopedandpowerful,becauseofdifficultiesinprogramming,andlowefficiency,modifycorrplexshortcomings,itisgraduallybeingreplacedbythetrend.Ofallthenewtechnology,JSP/Servletwithmoreefficientandeasytoprogram,morepowerful,moresecureandhasagoodportability,theyhavebeenmanypeoplebelievethatthefutureisthemostdynamicsiteofthefuturedevelopmentoftechnology.
SimilartoCGI,Servletsupportrequest/responsemodelWhenacustomersubmitarequesttotheserver,theserverpresentedtherequestServlet,Servletresponsibleforhandlingrequestsandgeneratearesponse,andthengavetheserver,andthenfromtheserversenttothecustomer.AndtheCGIisdifferent,Servletnotgenerateanewprocess,butwithHTTPServeratthesameprocess.Itthreadsthroughtheuseoftechnology,reducetheservercosts.Servlethandlingoftherequestprocessisthis:
Whenreceivedfromtheclient'srequest,callingservicemethods,themethodofServletarrivalofthefirstjudgementiswhattypeofrequest(GET/POST/HEAD...),thencallstheappropriatetreatment(DoGet/doPost/doHead...)andgeneratearesponse.
Althoughsuchacomplex,infact,simplysaidtoServletisaJavaclass.AndthegeneralcategoryofthedifferenceisthatthistypeoperatinginaServletcontainer,whichcanprovidesessionmanagementandtargetedlifecyclemanagement.SothatwhenyouusetheServlet,youcangetallthebenefitsoftheJavaplatform,includingthesafetyofthemanagement,useJDBCaccessthedatabaseandcrossplatfbrmcapability.Moreover,Servletusingthread,andcandevelopmoreefficientWebapplications.
JSPtechnologyisakeyJ2EEtechnology,itatahigherlevelofabstractionofaServlet.ItallowsconventionalstaticanddynamicHTMLcontentgeneratedbycombininganHTMLpagelookslike,butasaServlettorun.TherearemanycommercialapplicationserversupportJSPtechnology,suchasBEAWd?
Logic,IBMWebSphere,JRun,andsoon.JSPandServletusemorethansingle.IfyouhaveaJSPsupportforWebservers,andaJSPdocument,youcanputitFangdaoanystaticHTMLfilescanbeplaced,donothavetocompile,donothavetopack,donothavetoClassPathsettings,youcanvisitasordinaryWebItdidvisit,theserverwillautomaticallyhe字youtodootherwork.
JSPdocumentlookslikeanordinarystaticHTMLdocument,butinsidecontainsanumberofJavacode.Ituses.Jspthesuffix,usedtotelltheserverthisdocumentinneedofspecialtreatment.WhenwevisitaJSPpage,thedocumentwillfirstbetranslatedintoaJSPengineJavasourcefiles,isactuallyaServlet,andcompiler,andthen,likeotherServlet,fromServletenginetohandle.Servletengineofthistypeloading,handlingrequestsfromcustomers,andtheresultsreturnedtothecustomer.
Afteranothervisitthispagetothecustomer,aslongasthepapertherehavebeennochanges,JSPenginehasbeenloadeddirectlycalltheServletIfyouhavealreadybeenmodified,itwillbeonceagaintheimplementationoftheaboveprocess,translate,conpileandload.Infact,thisistheso-callednfirstpersontopunishment.”Becausewhenthefirstvisittotheimplementationofaseriesoftheaboveprocess,sowillspendsometimeaftersuchavisitwouldnot.
JavaservletsofferapowerfulAPIthatprovidesaccesstoalltheinformationabouttherequest,thesession,andtheapplication,combiningJSPwithservletsletsyouclearlyseparatetheapplicationlogicfromthepresentationoftheapplication;inotherwords,itletsyouusethemostappropriatecomponenttypefortherolesofModel,ViewandController.
Servlets,Filters,andListeners
AservletisaJavaclassthatextendsaserverwithfunctionalityforprocessingarequestandproducingaresponse.IfsimplementedusingtheclassesandinterfacesdefinedbytheServletAPI.TheAPIconsistsoftwopackages:
thejavax.servletpackagecontainsclassesandinterfacesthatareprotocolindependent,whilethejavax.servlet.httppackageprovidesHTTP-specificextensionsandutilityclasses.
Whatmakesaservletaservletisthattheclassimplementsaninterfacenamedjavax.servlet.Servlet,eitherdir