![個人博客網(wǎng)站設(shè)計外文文獻(xiàn)及翻譯及感應(yīng)式ID卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書_第1頁](http://file4.renrendoc.com/view11/M03/26/2C/wKhkGWWlKgaAN-T3AAKW-dJnqZU204.jpg)
![個人博客網(wǎng)站設(shè)計外文文獻(xiàn)及翻譯及感應(yīng)式ID卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書_第2頁](http://file4.renrendoc.com/view11/M03/26/2C/wKhkGWWlKgaAN-T3AAKW-dJnqZU2042.jpg)
![個人博客網(wǎng)站設(shè)計外文文獻(xiàn)及翻譯及感應(yīng)式ID卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書_第3頁](http://file4.renrendoc.com/view11/M03/26/2C/wKhkGWWlKgaAN-T3AAKW-dJnqZU2043.jpg)
![個人博客網(wǎng)站設(shè)計外文文獻(xiàn)及翻譯及感應(yīng)式ID卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書_第4頁](http://file4.renrendoc.com/view11/M03/26/2C/wKhkGWWlKgaAN-T3AAKW-dJnqZU2044.jpg)
![個人博客網(wǎng)站設(shè)計外文文獻(xiàn)及翻譯及感應(yīng)式ID卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書_第5頁](http://file4.renrendoc.com/view11/M03/26/2C/wKhkGWWlKgaAN-T3AAKW-dJnqZU2045.jpg)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
外文文獻(xiàn)資料收集:應(yīng)用技術(shù)學(xué)院計算機科學(xué)與技術(shù)(外文文件名:JSPSplittingforImprovingExecutionPerformance)AbstractSplittingaJSP(JavaServerPages)pageintofragmentscanimprovetheexecutionperformanceofJSPpageswhentheWebapplicationservercanseparatelycachetheWebpagefragmentsobtainedbyexecutingtheJSPfragments.IfaJSPpageissplitintofragmentsaccordingtotheupdatefrequencyofeachportionoftheWebpageobtainedbyexecutingtheJSPpage,allofthesplitJSPfragmentsdonotneedtobeexecutedagainwhenonlyasinglecachedpartofaWebpageexpires.Inaddition,thefragmentsofaJSPpagecanbereusedbyotherJSPpages.Inbothcases,theexecutionresultsofalloftheJSPfragmentssplitfromtheJSPpagemustbethesameasfromtheJSPpagebeforeitwassplit.Inthispaper,weproposeJSPsplitting,whichisamethodofsplittingaJSPpageintofragmentsmaintainingthedataandcontroldependencesexistingintheoriginalJSPpage.JSPsplittingautomaticallydetectstheportionsneededtomaintainthedataandcontroldependencesofaJSPpagefortheportionsthatdeveloperswanttosplitfromtheJSPpage.WeimplementedJSPsplittingwithaGUItool,andconfirmedthatthesplitJSPfragmentswereexecutedinthesameasthewayastheJSPpagebeforethesplit.ExperimentalresultsshowthattheresponsetimetoaccessaWebpagecanbereducedbysplittingaJSPpageintofragmentsandsettingdifferentcachingperiodsfortheWebpagefragmentsobtainedbyexecutingtheJSPfragments.1.IntroductionSplittingaJSP(JavaServerPages)pageintofragmentscanimprovetheexecutionperformanceofsomeJSPpageswhentheWebapplicationservercanseparatelycachetheWebpagefragmentsobtainedbyexecutingthefragmentsoftheJSPpage.TheperiodofcachingdynamicWebpagesgeneratedbyaJSPengineislimitedduetothedynamicnatureofthecontent.WhenthecachedcontentofaWebpagegeneratedbyaJSPengineisupdated,theentireJSPpagemustbeexecutedagainontheapplicationserver,eventhoughthechangeoftheWebpagemightbesmall.SincefrequentupdatesofcachedWebpagesincreasetheloadonanapplicationserver,itisreasonabletosplitaJSPpageintofragmentsandsetdifferentcachingperiodsfortheWebpagefragmentsobtainedbyexecutingtheJSPfragments.Ofcourse,theWebpagefragmentsmustbemergedintoafinalWebpagecorrectly.TheDynacachetechnologyofIBMWebSphereApplicationServerallowsWebpagefragmentstohavedifferentcachingperiods.CachetaglibrariesprovidedbytheApacheJakartaProjectalsosupportdifferentcachingperiodsfortheJSPfragments.Inaddition,ESI(EdgeSideIncludes)technologyprovidesamechanismtocacheWebpagefragmentswithdifferentcachingperiods,andtomergethemintoafinalWebpageonanedgeserver.TheapplicationoffloadtechnologyofIBMWebSphereEdgeServerisanotherapproachtoimprovetheexecutionperformanceofJSPpages.ThistechnologyallowsoneormoreJSPfragmentstobecachedandexecutedonedgeservers.TheremainingJSPfragmentsaredeployedontheapplicationserverandarecalledbytheJSPfragmentsexecutedontheedgeserver.Thus,someoftheexecutionofaJSPpageisoffloadedtotheedgeserver.SplittingaJSPpagefacilitatesthereuseofJSPfragments.WhenaWebapplicationconsistsofmanyJSPpages,thesameportionstendtoexistinmanyJSPpages.Examplesaretheframes,thebanners,theheaders,andetc.WhenaJSPpageissplitintofragments,thetotalexecutionresultofallofthefragmentsmustbethesameastheJSPpagebeforeitwassplit.Inaddition,whenthefragmentsofaJSPpageareexecutedindifferentservers,eachfragmentneedstobeexecutedwithouttheotherfragments.Inordertosatisfytheseconditions,weproposeJSPsplitting,whichisthemethodofsplittingaJSPpageintofragmentsdescribedinthispaper.SinceitisverydifficulttoautomaticallyfindthebestwaytosplitaJSPpageintofragmentsforsomeparticularpurpose,weassumethatthedeveloperswillselecttheportionsthattheywanttosplitintofragments.InordertoexecuteallofthedividedJSPpagescorrectly,JSPsplittingautomaticallydetectsanyportionsthatmustbemovedorcopiedintoafragmentwiththeselectedportions.ThedetectionisdonebasedontheanalysisofthedataandcontroldependencesexistinginaJSPpage.JSPsplittingissimilartotheprogramslicingtechniquethatslicesaprogrambasedonthedataandthecontroldependences.However,theprogramslicingtechniquedoesnottakeintoaccountthattheslicedprogramsareexecutedindependentlyandthatthetotalexecutionresultoftheslicedprogramsmustbethesameastheprogrambeforethedivision.Inaddition,sincedataispassedtotheJSPengineduringtheexecutionofJSPpages,thesourceprogramoftheJSPengine,suchasApacheTomcat,isrequiredinordertoanalyzethedatadependencescorrectly.Thisisimpractical,becausethesourceprogramoftheJSPengineisverylargeandcomplex.JSPsplittingavoidstheanalysisoftheJSPenginebyutilizingthecharacteristicsofJSP.Therestofthepaperisorganizedasfollows.Section2explainsthedifficultyofsplittingaJSPpageintofragments.Section3givesdetailsofthealgorithmtosplitaJSPpage.Section4describestheJSPsplittingtoolthatisanimplementationofJSPsplittinganddemonstrateshowasampleJSPpageissplitbythetool.Section5showstheexperimentalresultsobtainedbyexecutingthesplitJSPfragmentswithdifferentcachingperiodsontheIBMWebSphereApplicationServer.Section6discussespreviousworkinrelationtoourcontributions.Ourconclusionsformthefinalsection.2.DifficultyofSplittingaJSPPageInthispaper,splittingaJSPpagemeansthatsomeportionsoftheJSPpagearecutfromtheJSPpageandsavedasnewJSPpages.SuchnewlycreatedJSPpagesareincludedintheoriginalJSPpagebyusingsomemechanismsuchasthejsp:includetag.WecalltheincludedJSPpagetheJSPfragment,andcalltheJSPpagethatinvokestheJSPfragmentsthemasterJSPpage.AmasterJSPpageinvokesJSPfragmentsandreceivesWebpagefragmentsobtainedbyexecutingthem.ThenthemasterJSPpagemergesitsownWebpagefragmentwiththeWebpagefragmentsreceivedfromtheJSPfragments,andcreatesafinalWebpage.JSPfragmentsarenotalwaysexecutedinthesameserveroratthesametime.TheapplicationoffloadtechnologyallowsamasterJSPpageandJSPfragmentstobeexecutedindifferentservers.WhentheESImechanismisused,esi:includetagsareputintoaWebpagefragmentobtainedbyexecutingamasterJSPpageandinterpretedinanedgeserverthatsupportstheESImechanism.Inthiscase,theedgeservercheckswhetherornottheWebpagefragmentsspecifiedbyesi:includetagsexistinitscache.IfthecontentsofWebpagefragmentsarenotcachedorhaveexpired,theJSPfragmentsareinvokedfromtheedgeserver,andexecutedinoneormoreapplicationservers.IfdifferentcachingperiodscanbegiventotheWebpagefragmentsobtainedbyexecutingtheJSPfragments,eachJSPfragmentisexecutedonlywhenthecachedcontenthasexpired.TheDynacachetechnology,theESImechanism,andthecachetaglibrariescansupportdifferentcachingperiodsforWebpagefragments.WhenaJSPpageissplitintofragments,thefollowingtwoconditionsmustbesatisfiedevenifthemasterJSPpageandtheJSPfragmentsarenotexecutedinthesameserveroratthesametime.Cond.1-1ThetotalexecutionresultofamasterJSPpageandtheJSPfragmentsisthesameastheJSPpagebeforeitwassplit.Cond.1-2EachJSPpage,whichiseitheramasterJSPpageoraJSPfragment,maybeexecutedwithoutotherJSPpages.TheseconditionsaresatisfiedbymaintainingthedataandcontroldependencesexistinginaJSPpageaftertheJSPpagehasbeensplitintofragments.However,itishardworkfordeveloperstodetectdataandcontroldependentportionsinaJSPpage,becausethedataandcontrolflowofaJSPpagecanbedividedamongtheJSPpage,theJSPenginethatexecutestheJSPpage,anyJavabeansusedintheJSPpage,andetc..Thus,anaturalsolutioncallsforautomaticallydetectingdata-dependentandcontrol-dependentportionslinkedtotheportionsthatdeveloperswanttosplit.TheprogramslicingtechniquedetectsasetofprogramstatementsthataffectaprogramstatementSbyanalyzingthedataandcontroldependencesexistingintheprogram.OneprogramsliceconsistsofthedetectedsetofprogramstatementsandthestatementS.Thistechniqueisusefulwhendebuggingormaintaininglargeprograms.SinceJSPpagesarecompiledintoservletprogramsbyusingaJSPcompilersuchastheApacheJaspercompiler[4],JSPslicescanbeobtainedbyapplyingprogramslicingtechniquetoaservletprogramcompiledfromaJSPpage.However,theprogramslicingtechniqueisnotsufficienttosplitaJSPpageintofragments,becausethetechniquedoesnottakeintoaccountthatprogramslicesareexecutedindependently.Figure1showsapartofasampleJSPpageandasampleservletprogramcompiledfromtheJSPpage.Figure2(a)showsthedatadependencegraphobtainedfromtheservletprogram.Inaprogram,whenastatementS1assignsavaluetoavariableandastatementS2followingS1usesthatvalue,atruedatadependenceexistsbetweenS1andS2.SuchadatadependenceisdenotedasS1S2.InFigure2(a),duetothedatadependences,theprogramsliceforthestatementS10consistsofS1,S9,andS10.Iftheprogramsliceiscutfromtheservletprogram,theremainingprogramstatementshaveerrorsbecausethedatadependencesS1S2,S11,andS12andS9S11andS12arenothonored.Thus,theprogramslicingtechniquedoesnotworkwellforsplittingJSPpages.3.JSPSplittingInthispaper,weproposeJSPsplitting,amethodofsplittingaJSPpageintofragments.TheproposedmethodanalyzesdataandcontroldependencesintheservletprogramcompiledfromaJSPpage.Atthetimeofanalysis,JSPsplittingtakesintoaccountthatsplitJSPpageswillbeexecutedindependently,andmaynotbeexecutedinthesameserveroratthesametime.First,theportionsthatdeveloperswanttosplitintoaJSPfragmentareselected.Fortheselectedportions,theportionsneededtosatisfytheconditions1-1and1-2aredetected.Thedetectedportionsarecategorizedintomovedandcopiedportions,andareminimizedinordertomatchtheintentionsofthedevelopers.3.1.IgnorableDataDependencesBasically,JSPsplittingdoesnotallowthedependentstatementstobesplitapart.However,ifthisruleisappliedtoostrictly,noneofthestatementsshowninFigure1(b)canbesplit,becausethereareinterlockingdependencesstartingfromS1andS9.Here,weconsiderhowthevariableoutshowninFigure1(b)isused.ThevariableoutisusedtowritethetextdataofanyWebpage.NotethatthevalueofoutcanberetrievedfromanyJSPengine.WhenamasterJSPpageJMincludesaJSPfragmentJFbyusingajsp:includetagandaJSPengineexecutesbothofthem,JMfirstretrievesthevalueofoutfromtheJSPengineandwritesitsowntextdatatothevalue.Next,JMinvokesJF.Afterbeinginvoked,JFalsoretrievesthevalueofoutandwritesitsowntextdatatothevalue.ThetextdatawrittenbyJMisreturnedtooutthroughtheJSPengineandmergedwiththetextdatawrittenbyJM.ThismeansthatthevalueofoutcanbeutilizedbyanyJSPpageandthetextdatawrittentothevalueismaintainedbytheJSPengines.Inotherwords,whenaJSPpageissplitintofragments,astatementthatretrievesthevalueofoutcanexistbothinaservletprogramcompiledfromamasterJSPpageandinservletprogramscompiledfromJSPfragments.Therefore,thedatadependencesforthevariableoutcanbeignoredatthetimeofsplittingaJSPpage.AsshowninFigure2(a),noneofthestatementscanbesplitwhilemaintainingthedatadependencesexistingintheservletprogramshowninFigure1(b).However,ifthedatadependencesforthevariableoutareignored,thedatadependencegraphischangedasshowninFigure2(b).UsingthedatadependencegraphshowninFigure2(b)makesitpossibletosplitS2fromthesetofS9,S10,S11,andS12whichcannotbesplitduetothedatadependencesforthevariablebook.InservletprogramscompiledbytheApacheJaspercompiler,thedatadependencesforthevariablesshowninTable1canbeignoredforthesamereasonasforthevariableout.Sincethevaluesofthesevariablesaredefinedatthetopofeachservletprogramandarefrequentlyreferredto,moststatementscannotbesplitifthedatadependencesaretobemaintained.Ingeneral,theout-of-orderexecutionisallowedforthestatementswithoutdataandcontroldependences.IgnoringthedatadependencesforthevariablesshowninTable1mayintroduceanincorrectexecutionorderofstatements.Forexample,ifS10andS12showninFigure1aresplitintoaJSPfragmentandtheJSPfragmentisincludedbeforeS11,anincorrectWebpageisgenerated.Inordertoavoidsuchincorrectexecution,ouralgorithmdoesnotallowchangesintheorderofthestatementsthathaveignoreddatadependences.3.2.AnalysisofDataDependencesforJavabeansInaJSPpage,Javabeansarefrequentlyusedtostoreandretrievedataaspropertyvalues.EachJavabeanisaJavaobjectanddeveloperscanuseJavabeansbyusingthreekindsoftagsinaJSPpage.●jsp:useBean:DeclaresanamedJavabeanwithitsscope.WhenanobjectfortheJavabeandoesnotexistwithinthedeclaredscope,thebeanisinstantiated.Javabeanscanbedeclaredwiththescopeofpage,request,sessionorapplication.●jsp:getProperty:CallsthegetmethodofaJavabeanobjectandretrievesthepropertyvalue.●jsp:setProperty:CallsthesetmethodofaJavabeanobjectandsetsthepropertyvalue.Javabeansmustbedeclaredwiththejsp:useBeantagbeforetheothertwooperations.ThismeansthatadeclarationofaJavabeanandalloftheotheroperationsfortheJavabeanmustbeincludedinthesameJSPpage.ThisstronglylimitstheextentofaJSPfragment.Inordertorelaxthelimitation,JSPsplittingallowsdeclarationsofJavabeanstobecopiedtoJSPfragments.ThereasonwhydeclarationsofJavabeanscanbecopiedisthatthedeclarationsdonothavesideeffects.EachdeclarationmerelyinstantiatesaJavabeanobjectwhentheJavabeanobjecthasnotyetbeeninstantiatedwithinitsscope.Inotherwords,aJavabeanobjectisnotinstantiatedmorethanonetimewithinitsscopeevenifthedeclarationiscopiedtoJSPfragments.Therefore,someoftheoperationsforaJavabeancanbesplitintofragments.WhenapropertyvalueissetforaJavabeanbyusingajsp:setPropertytagandretrievedfromtheJSPbeanbyusingajsp:getPropertytag,atruedatadependenceexistsbetweenthetwooperations.Whentherulethatdatadependentstatementscannotbesplitisapplied,datadependentoperationsforaJavabeanmustbeincludedinthesamefragment.However,adatadependencebetweenanoperationthatsetsapropertyvalueforaJSPbeanandanotheroperationthatretrievesthepropertyvalueismaintainedafterthetwooperationsaresplitifthefollowingtwoconditionsaresatisfied.Cond.2-1ThescopeoftheJavabeanis”request”,”session”,or”application”.Cond.2-2ThesplitJSPpagesareexecutedinthesameJSPengine.Iftheseconditionsaresatisfied,JSPsplittingallowstheoperationsamongwhichthedatadependencesexisttobesplitintodifferentJSPpages,becausetheJavabeanlivesintheJSPengineduringtheexecutionofthesplitJSPpages.Asaresult,theportionssplitalongwiththeportionsselectedbyadevelopercanbereduced.However,theWebpagefragmentsobtainedbyexecutingthesplitJSPpagessatisfyingtheseconditionsmusthavethesamecachingperiod.ThisisbecausethedatadependenceisnotmaintainedifaJSPpagewasexecutedandavalueisdefinedintheJSPpagewhileanotherJSPpage,inwhichthedefinedvalueisused,wasnotexecutedduetothevalidcachedcontentoftheWebpage.WhenaJavabeanhasthepagescope,thedependentoperationsfortheJavabeancannotbesplit.However,eachoperationthatsetsapropertyvalueforaJavabeanwiththepagescopecanbecopiedalongwithoneormoreoperationsthatretrievethesamepropertyvalue,becausetheoperationsthatsetpropertyvaluesforJavabeanswiththepagescopedonothavesideeffects.Figures3to6showthealgorithmstosplittheoperationsforJavabeans.ThesealgorithmstrytominimizethenumberoftheoperationsthataremovedorcopiedtoaJSPfragment.4.JSPSplittingToolWeimplementedJSPsplittingasaplug-inforEclipse。Figure7showsthearchitectureoftheJSPsplittingtool.TheJSPsplittingeditorpresentsthesourceviewandtheoutlineviewofaJSPpage.Developersselecttheportionsthattheywanttosplitusingeithertheeditorortheoutline.Aftertheportionsareselectedbydevelopers,themovedandcopiedportionsaredisplayedinadialogwiththeselectedportions.AlloftheportionsareputintoanewJSPpagespecifiedbydevelopers,andthemovedportionsarereplacedwiththe<jsp:include>tagintheoriginalJSPpage.WhentheeditorisinvokedwithaJSPpage,thedataandcontroldependencesexistingintheJSPpageareanalyzed.First,theJSPcompiler,whichisbasedontheApacheJaspercompiler,compilesaJSPpageintoaservletprogram.TheJSPcompilerpartitionstheJSPpageintothepartsthatarecategorizedasshowninTable2,andgeneratesoneormoreJavastatementsforeachpart.Atthistime,themappingtablebetweeneachpartoftheJSPpageandoneormorestatementsoftheservletprogramisgenerated.TheJSP-Servletmapperconvertstheoriginalgroups,eachofwhichcontainsdependentstatementsofaservletprogram,intonewgroups,eachofwhichcontainsthedependentJSPparts,byusingthemappingtablebetweenthepartsofaJSPpageandthestatementsoftheservletprogram.ThismappingtablewasgeneratedearlierduringtheJSPcompilationstage.ThegeneratedJSPgroupsarepassedtotheJSPsplitter.5.ExperimentWemeasuredtheexecutionperformanceofJSPpagessplitbyusingourtool.TheJSPpagewasexecutedonWebSphereApplicationServer,withtheDynacachemechanismenabled.Forcomparison,wesplitalloftheportionsthatdynamicallyoutputWebpagefragmentsintojustoneJSPfragment,anddidnotcachetheWebpagegeneratedfromtheJSPfragment,becausethegeneratedWebpageincludedtheprivateinformationfromthefragment.However,theothertextfragmentswerecachedfor30seconds.Wecallthiskindofdivisionthecoarse-grainsplitting.Inaddition,wemeasuredtheexecutionperformancewhentheWebpagewasnotcached.Forthesemeasurements,weusedaclientprogramthatcontinuestosendrequestsfortheJSPpagefor5minutesandcountsthenumberofthereceivedresponses.EachrequestissenttothelocalWebapplicationserverafterithasreceivedtheresponseforthepreviousrequest.6.RelatedWorkAsmentionedinSection2,theprogramslicingtechniqueissimilartoourmethod.However,theprogramslicingtechniquedoesnotassumethateachslicedprogramisexecutedasanindependentprogramthoughthetotalexecutionresultoftheslicedprogramshastobethesameastheprogrambeforeitwassliced.Therefore,theprogramslicingtechniquecannotbeappliedtothesplittingofJSPpages.TheExtractMethodisasoftwarerefactoringtechniquethatconvertsseveralprogramstatementsintoanewmethod.Thistechniqueincreasesthechancesthatothermethodscanusetheextractedmethods.Thestatementsconvertedintoamethodareselectedbydevelopers.Thistechniqueissimilartoourmethod.Afterthestatementsareselected,theparametersthatmustbepassedtothenewmethod,andthereturnvalueofthenewmethodaredetermined.7.ConclusionInthispaper,weproposedJSPsplittingasamethodofsplittingaJSPpageintofragmentsinordertoimprovetheexecutionperformanceandthereusabilityoftheJSPpages.Inthefuture,wearegoingtointroduceamethodthatcompensatesforthislackofinformationbyinteractingwithdevelopers.感應(yīng)式IC卡辦公門禁考勤一卡通管理系統(tǒng)方案計劃書PagePAGE34ofNUMPAGES49中文翻譯稿翻譯:應(yīng)用技術(shù)學(xué)院06計算機科學(xué)與技術(shù)(0616403057)傅曉燕2010年2月(中文名:改進(jìn)執(zhí)行性能的JSP切分)摘要當(dāng)網(wǎng)頁應(yīng)用服務(wù)器能分別存儲通過執(zhí)行JSP片段獲得的網(wǎng)頁頁面片段時,把一個JSP(Java服務(wù)器頁面)頁面切分成若干個片段能改進(jìn)JSP頁面的執(zhí)行性能。如果一個JSP頁面根據(jù)通過執(zhí)行JSP頁面獲得的網(wǎng)頁頁面的每一個部分的不斷跟新被切成若干片段,所有切分的JSP片段不需要被再次執(zhí)行,只有當(dāng)需要調(diào)用的網(wǎng)頁片段在緩存中過期了。另外,一個JSP頁面的片段能夠被其他的JSP頁面再次使用。在這兩種情況下,所有的從JSP頁面中切分的JSP片段的執(zhí)行結(jié)果必須與在JSP頁面切分之前一樣。在這篇文章中,本文提出JSP切分,它是一種把JSP頁面切分成片段的方法,維持了存在于源JSP頁面的數(shù)據(jù)和控制依賴。JSP切分自動檢測了需要維持JSP頁面的數(shù)據(jù)和控制依賴的部分,因為開發(fā)者想要從JSP頁面中切分這部分。我們使用GUI工具實施JSP切分,并且證實切分的JSP片段和JSP頁面切分之前是以同一方式執(zhí)行的。實驗結(jié)果顯示通過切分一個JSP頁面為片段和為通過執(zhí)行JSP片段獲得的網(wǎng)頁片段設(shè)置不同的存儲方法能夠減少訪問網(wǎng)頁的響應(yīng)時間。1.引言當(dāng)網(wǎng)頁應(yīng)用服務(wù)器能夠分別的存儲通過執(zhí)行JSP頁面的片段獲得的網(wǎng)頁片段時,把一個JSP頁面切分成若干片段能改善一些JSP頁面的執(zhí)行性能。由于內(nèi)容的動態(tài)性,通過JSP引擎產(chǎn)生的存儲動態(tài)網(wǎng)頁的方法是受限的。當(dāng)通過JSP引擎產(chǎn)生的網(wǎng)頁的存儲內(nèi)容被更新,整個JSP頁面必須在應(yīng)用服務(wù)器上再次被執(zhí)行,盡管網(wǎng)頁的改變可能很小。由于存儲網(wǎng)頁的不斷更新增加應(yīng)用服務(wù)器上的負(fù)載,它合理的把JSP頁面切分成為若干個片段,并且為通過執(zhí)行JSP片段獲得的網(wǎng)頁片段設(shè)置不同的存儲方法。當(dāng)然,網(wǎng)頁片段必須被正確的合并為一個最終的網(wǎng)頁。IBM的WebSphere應(yīng)用服務(wù)器的動態(tài)緩存技術(shù)允許網(wǎng)頁片段有不同的存儲方法。由ApacheJakarta項目提供的存儲標(biāo)簽庫也為JSP片段支持不同的存儲方法。另外,ESI(EdgeSideIncludes)技術(shù)為使用不同的存儲方法存儲網(wǎng)頁片段提供了一個機制,并且在一個邊緣服務(wù)器上把他們合并成一個最終的網(wǎng)頁。IBM的WebSphere邊緣服務(wù)器的應(yīng)用卸載技術(shù)是改善JSP頁面執(zhí)行性能的另一種方法。這種技術(shù)允許一個或多個JSP片段在邊緣服務(wù)器上存儲或執(zhí)行。其余的JSP片段部署在應(yīng)用服務(wù)器上并且訪問在邊緣服務(wù)器上執(zhí)行的JSP片段。因此,一些JSP頁面的執(zhí)行被下載到邊緣服務(wù)器上。切分一個JSP頁面便于JSP片段的重用。當(dāng)一個網(wǎng)頁應(yīng)用包含許多JSP頁面時,相同的部分傾向于存在許多的JSP頁面中。例如框架,橫幅,標(biāo)題等。當(dāng)一個JSP頁面被切分發(fā)為若干個片段時,所有片段的總的執(zhí)行結(jié)果必須與在切分之前是一樣的。另外,當(dāng)JSP頁面的片段在不同的服務(wù)器上執(zhí)行時,每一個片段需要在沒有其他片段的時候執(zhí)行。為了滿足這些條件,我們提出了JSP切分,它是一種在本文中描述的把一個JSP頁面切分成若干片段的方法,由于為了一些特別的目的很難自動的找到最好的方法來把JSP頁面切分成若干個片段,我們假設(shè)開發(fā)者會選擇他們想要切分的片段的那部分。為了正確的執(zhí)行所有分開的JSP頁面,JSP切分自動地檢測了一些部分,那些部分必須和一些選擇的部分被移動或復(fù)制到一個片段中。這個檢測是基于對存在于JSP頁面中的數(shù)據(jù)和控制依賴做的。JSP切分類似于程序切片技術(shù),它是基于數(shù)據(jù)和控制依賴切一個程序的。然而,程序的切片技術(shù)沒有考慮到被切的程序能被獨立的執(zhí)行,以及切的程序的總的執(zhí)行結(jié)果必須和沒有分離以前是一致的。另外,由于數(shù)據(jù)在JSP頁面的執(zhí)行中被傳送到JSP引擎,JSP引擎的源程序,例如ApacheTomcat,為了正確的分析數(shù)據(jù)依賴是必須的。這是不切實際的,因為JSP引擎的源程序是非常大而且復(fù)雜的。JSP切分通過利用JSP特征避免了JSP引擎的分析。這篇文章的其余編排如下。章節(jié)2解釋了把JSP頁面切分成若干個片段的難點。章節(jié)3給出了切分一個JSP頁面算法的詳情。章節(jié)4描述了JSP切分工具是JSP切分的實現(xiàn)工具并演示了由這個工具是如何把一個JSP例子切分的。章節(jié)5顯示了通過在IBMWebSphere應(yīng)用服務(wù)器上使用不同的存儲方法來執(zhí)行切分JSP片段獲得的實驗的結(jié)果。章節(jié)6討論有關(guān)我們的貢獻(xiàn)的先前的工作。最后一章節(jié)是結(jié)論。2.切分JSP頁面的難點在這篇文章中,切分一個JSP頁面意味著JSP頁面的一些部分是從JSP頁面中切出來的并且保存為新的JSP頁面。這種新的創(chuàng)建JSP頁面包括使用一些如jsp(包括標(biāo)簽)的源JSP頁面。我們稱包含的JSP頁面為JSP片段,并且稱調(diào)用JSP片段的JSP頁面為主JSP頁面。一個主JSP頁面調(diào)用JSP片段并且接受通過執(zhí)行他們獲得的網(wǎng)頁片段。然后主JSP頁面合并它自己的網(wǎng)頁片段和從JSP片段中接收的網(wǎng)頁片段,并且創(chuàng)建了一個最終的網(wǎng)頁。JSP片段不是總是在同一服務(wù)器和同一時間執(zhí)行的。應(yīng)用卸載技術(shù)允許主JSP頁面和JSP片段在不同的服務(wù)器上執(zhí)行。當(dāng)ESI機制被使用,ESI:包括標(biāo)簽被放入通過執(zhí)行一個主JSP頁面獲得的網(wǎng)頁片段和在邊緣服務(wù)器上解釋來支持ESI機制。在這種情況下,邊緣服務(wù)器會檢查是否是由ESI指定的網(wǎng)頁片段:包括存在于它的緩存中的標(biāo)簽。如果網(wǎng)頁片段的內(nèi)容沒有被存儲或者已經(jīng)滿了,JSP片段會從邊緣服務(wù)器調(diào)用,并且在一個或多個應(yīng)用服務(wù)器上執(zhí)行。如果不同的存儲方法能夠考慮通過執(zhí)行JSP片段獲得的網(wǎng)頁片段。每一個JSP片段只有在存儲的內(nèi)容滿時才被執(zhí)行。這種動態(tài)存儲技術(shù),ESI機制,和存儲標(biāo)簽庫能夠為網(wǎng)頁片段提供的不同的存儲方法。當(dāng)JSP頁面被切分成若干片段,下面的兩個條件必須滿足,即使主JSP頁面還是JSP片段沒有在同一服務(wù)器和同一時間執(zhí)行。條件.1-1主JSP頁面和JSP片段的最終執(zhí)行結(jié)果要和JSP頁面被切分之前一致。條件.1-2每一個JSP頁面,無論是一個主JSP頁面還是一個JSP片段,能夠在沒有其它JSP頁面下執(zhí)行。這些條件通過維持存在于JSP頁面被切分成片段后的數(shù)據(jù)和控制自由來滿足。然而,對開發(fā)者來說在一個JSP頁面中監(jiān)測數(shù)據(jù)和控制依賴是困難的,因為JSP頁面的數(shù)據(jù)和控制流量能夠在JSP頁面中被分開,JSP引擎執(zhí)行JSP頁面,一些Javabeans在JSP頁面中被使用等等。因此,一個自然的解決方法需要自動地檢測連接到開發(fā)者想要切分的那部分的數(shù)據(jù)依賴和控制依賴。程序的切片技術(shù)檢測了一組程序申明,它通過分析存在于程序中的數(shù)據(jù)和控制依賴來影響程序申明S。一個程序片包含了檢測的一組程序申明和申明S。當(dāng)調(diào)試和維護(hù)大的程序時,這個技術(shù)是有用的。因為JSP頁面通過使用如ApacheJasper編譯器那樣的編譯器被編譯成servlet程序,JSP切分能夠通過應(yīng)用程序分化技術(shù)到JSP頁面中編譯的servlet中獲得。然而,程序切片技術(shù)不足以切分一個JSP頁面為片段,因為這個技術(shù)沒有考慮到程序切片被獨立的執(zhí)行。圖1顯示了JSP頁面例子的一部分和從JSP頁面中編譯的servlet程序的例子。圖2(a)顯示了從servlet程序中獲得的數(shù)據(jù)依賴圖表。在這個程序中,當(dāng)申明S1分配一個值到一個變量和申明S2跟S1使用那個值,一個真的數(shù)據(jù)依賴存在于S1和S2之間。這樣一個數(shù)據(jù)依賴被記為S1->S2。在圖2(a),基于數(shù)據(jù)依賴,對于申明S10的程序片包含S1,S9和S10。如果程序片是從servlet程序中切的,剩下的程序申明就有錯誤因為數(shù)據(jù)依賴S1->S2,S11和S12和S9->S11和S12是沒有實踐。因此,程序切片技術(shù)對于切分JSP頁面沒有做的很好。(a)JSP頁面部分(b)servlet程序部分圖1.一個JSP頁面例子和一個從JSP頁面中編譯得到的servlet程序(a)正常的(b)對out忽略數(shù)據(jù)依賴圖2.數(shù)據(jù)依賴圖標(biāo)3.JSP切分在這篇文章中,本文提出JSP切分,把JSP頁面切分成若干片段的一個方法。這個提出的方法分析了從JSP頁面中編譯的servlet程序的數(shù)據(jù)和控制依賴。在分析的時候,JSP切分考慮到切分JSP頁面會被獨立的執(zhí)行,并且可能不會在同一服務(wù)器和同一時間執(zhí)行。首先,開發(fā)者想要切分為JSP片段的那部分被選擇了。對于選擇的部分需要滿足條件1-1和1-2來被檢測。被檢測的部分要被分類到轉(zhuǎn)移和復(fù)制的部分,并且為了滿足開發(fā)者的意圖要被最小化。3.1不容忽略的數(shù)據(jù)依賴基本上,JSP切分不允許依賴的申明被分別的切分。然而,如果這個規(guī)則太嚴(yán)格的被應(yīng)用,在圖1(b)中顯示的申明沒有能被分化的,因為從S1到S9開始有交錯的依賴。這里,我們考慮在圖1(b)里顯示的變量out是怎樣使用的。變量out用于寫一些網(wǎng)頁的文本數(shù)據(jù)。注意out的值能夠從一些JSP引擎中檢索。當(dāng)一個主JSP頁面(Jm)包含通過使用JSP得到的JSP片段Jf:包括標(biāo)簽和JSP引擎兩個都執(zhí)行,Jm首先檢索JSP引擎中的out的值并且寫它自己的文本數(shù)據(jù)到這個值。接下來,Jm調(diào)用Jf。在被調(diào)用后,Jf也檢索out的值并且寫它自己的文本數(shù)據(jù)到這個值。通過Jf寫的文本數(shù)據(jù)通過JSP引擎被返回到Jm,并且與Jm寫的文本數(shù)據(jù)合并。這意味著out的值能夠被一些JSP頁面使用并且寫入這個值的文本數(shù)據(jù)由JSP引擎維持。換句話說,當(dāng)JSP頁面被切分成為片段時,檢索out的值申明能夠存在于從主JSP頁面編譯的servlet程序和從JSP片段編譯的servlet程序。因此,對于變量out的數(shù)據(jù)依賴在切分JSP頁面時能夠被忽略。正如在圖2(a)中顯示的,當(dāng)維持存在于圖1(b)中顯示的servlet程序的數(shù)據(jù)依賴時沒有申明能被切分。然而,如果對于變量out的數(shù)據(jù)依賴被忽略,那么數(shù)據(jù)依賴圖表就會像圖2(b)中顯示的那樣被改變。像圖2(b)中顯示的那樣使用數(shù)據(jù)依賴圖表使得從組S9,S10,S11和S12中切分S2變得可能,它不能夠依據(jù)變量book的數(shù)據(jù)依賴被分化。在被ApacheJasper編譯器編譯的servlet程序中,對于表1里顯示的變量的數(shù)據(jù)依賴能和變量out相同的原因被忽略。由于這些變量的值被定義在每個servlet程序的最高端并且被頻繁的提到,如果數(shù)據(jù)依賴能夠被保持,那么大多數(shù)申明不能被切分。一般來講,無序執(zhí)行對于沒有數(shù)據(jù)控制依賴的申明是允許的。忽略在表1里顯示的變量的數(shù)據(jù)依賴可能會產(chǎn)生申明的一個錯誤的執(zhí)行順序。例如,如果在圖1中顯示的S10和S11被切分成一個JSP片段,并且這個JSP片段在S11之前被包含了,一個錯誤的網(wǎng)頁就會產(chǎn)生。為了避免這種錯誤的執(zhí)行結(jié)果,由于已經(jīng)忽略了數(shù)據(jù)依賴的申明,我們的算法不允許改變。表1.這些變量的數(shù)據(jù)依賴被忽略3.2.對于Javabeans數(shù)據(jù)依賴的分析在一個JSP頁面中,Javabeans作為屬性值被頻繁的用來存儲和檢索數(shù)據(jù)。每一個Javabean是一個Java項目并且開發(fā)者能夠通過使用JSP頁面中的三種標(biāo)簽來使用Javabeans?!駄sp:使用Bean:在它的范圍內(nèi)申明一個Javabean。當(dāng)這個Javabean的項目不在它申明的范圍內(nèi),這個bean就會被實例化。Javabeans能夠申明在頁面,請求,節(jié)或者應(yīng)用的范圍內(nèi)?!駄sp:獲得屬性:稱為獲得Javabean項目的方法并且檢索屬性值。●jsp:設(shè)置屬性:稱為設(shè)置Javabean項目的方法并且設(shè)置屬性值。Javabeans必須用jsp申明:在另兩個操作之前使用Bean標(biāo)簽。這意味著Javabean的申明和Javabean的所有其他的操作必須包含在同一JSP頁面中。這大大限制了JSP片段的范圍。為了緩和這個限制。JSP切分允許Javabeans的申明復(fù)制到JSP片段中。為什么Javabeans的申明能夠被復(fù)制的原因是申明沒有副作用。當(dāng)Javabean對象在它的范圍內(nèi)還沒有被實例化每一個申明僅僅實例化了一個Javabean對象。換句話說,一個Javabean對象在它的范圍內(nèi)不超過一次被實例化,即使申明被復(fù)制到JSP片段中。因此,一些Javabean的操作能夠被切分成片段。當(dāng)一個屬性值通過使用JSP來設(shè)置javabean:設(shè)置屬性標(biāo)簽并且通過使用JSP從JSPbean中檢索:獲得屬性標(biāo)簽,一個真實的數(shù)據(jù)依賴存在于兩個操作之間。當(dāng)數(shù)據(jù)依賴申明不能被分化這個規(guī)則被應(yīng)用,對于Javabean的數(shù)據(jù)依賴操作必須被包含在同一片段中。然而,如果下面的兩個條件被滿足,當(dāng)兩個操作被切分后,在JSPbean設(shè)置一個屬性值的操作和另一個檢索屬性值的操作之間數(shù)據(jù)依賴被保持著。條件.2-1Javabean的范圍是“request”,“session”,或者是“application”。條件.2-2切分的JSP頁面在同一JSP引擎中執(zhí)行。如果這兩個條件被滿足,JSP切分允許存在于數(shù)據(jù)依賴中的操作被切分化成不同的JSP頁面,因為在切分的JSP頁面執(zhí)行中,Javabean存在于JSP引擎中。因此,切分的部分和由開發(fā)者選擇的部分能夠被簡化。然而,通過執(zhí)行滿足這兩種條件的切分的JSP頁面獲得的網(wǎng)頁片段必須有相同的存儲周期。如果一個JSP頁面被執(zhí)行并且這個值在JSP頁面中被定義而這個被定義的值在另一個頁面中使用,由于網(wǎng)頁有效的存儲內(nèi)容沒有被使用,這是因為數(shù)據(jù)依賴么有被保持。當(dāng)Javabean有頁面范圍,對于Javabean的依賴操作不能被切分。然而,在頁面范圍內(nèi)為Javabean設(shè)置一個屬性值的每一操作隨著一個或多個檢索相同屬性值的操作能夠被復(fù)制,因為在頁面范圍內(nèi)為Javabean設(shè)置屬性值的操作沒有副作用。4.JSP切分工具我們作為Eclipse的一個插件來實現(xiàn)JSP切分的。圖7顯示了JSP切分工具的結(jié)構(gòu)。JSP切分編輯介紹了JSP頁面的源視圖和大綱視圖。開發(fā)者通過或者使用editor或者使用outline選擇他們想要切分的那部分。當(dāng)那部分被開發(fā)者選擇后,移掉的或者是復(fù)制的那部分和選擇的那部分被顯示在對話框里。所有的部分被放進(jìn)由開發(fā)者指定的一個新的JSP頁面里,在源JSP頁面中,移掉的部分被替換為<jsp:include>標(biāo)簽。當(dāng)編輯者調(diào)用一個JSP頁面時,存在于JSP頁面的數(shù)據(jù)和控制依賴被分析。首先,JSP編譯器,它是基于ApacheJasper編譯器的,把一個JSP頁面編譯成一個servlet程序。JSP編譯器把JSP頁面分成幾部分然后像表2那樣存儲,并且為每一部分形成一個或多個Java聲明。這時,在JSP頁面中的每一部分和servlet程序中的一個或多個申明之間的映射表被形成。JSP-Servlet映射器轉(zhuǎn)換源組,每一個都把servlet程序中的依賴聲明包含在新的組中,每一個都包含在依賴的JSP部分中,通過使用JSP頁面中的部分和servlet程序聲明之間的映射表。這個映射表在JSP編譯階段之前就形成了。形成的組被發(fā)送到JSP分離器。
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 湘教版數(shù)學(xué)八年級上冊2.6《已知角和邊作三角形》聽評課記錄
- 湘教版數(shù)學(xué)九年級上冊1.3《反比例函數(shù)的應(yīng)用》(第1課時)聽評課記錄
- 【部編人教版】八年級上冊歷史聽課評課記錄 第17課 中國工農(nóng)紅軍長征
- 生態(tài)土地租賃協(xié)議書(2篇)
- 湘教版七年級數(shù)學(xué)下冊1.2二元一次方程組的解法1.2.1代入消元法(2)聽評課記錄
- 湘教版數(shù)學(xué)八年級上冊1.4《分式的加法和減法》聽評課記錄1
- 人教版數(shù)學(xué)七年級下冊《5-3-1平行線的性質(zhì)》聽評課記錄
- 吉林省七年級數(shù)學(xué)下冊第8章一元一次不等式8.2解一元一次不等式8.2.3解一元一次不等式聽評課記錄新版華東師大版
- 冀教版七年級數(shù)學(xué)上冊 1.6 有理數(shù)的減法 聽評課記錄
- 北師大版道德與法治七年級下冊10.2《積極面對競爭》聽課評課記錄
- 體育活動策劃與組織課件
- 公司違規(guī)違紀(jì)連帶處罰制度模版(2篇)
- 2025屆高考物理二輪總復(fù)習(xí)第一編專題2能量與動量第1講動能定理機械能守恒定律功能關(guān)系的應(yīng)用課件
- T型引流管常見并發(fā)癥的預(yù)防及處理
- 2024-2025學(xué)年人教新版九年級(上)化學(xué)寒假作業(yè)(九)
- 內(nèi)業(yè)資料承包合同個人與公司的承包合同
- 【履職清單】2024版安全生產(chǎn)責(zé)任體系重點崗位履職清單
- 2022年全國醫(yī)學(xué)博士英語統(tǒng)一考試試題
- 《工業(yè)自動化技術(shù)》課件
- (績效考核)鉗工技能鑒定考核試題庫
- 2024年江蘇農(nóng)牧科技職業(yè)學(xué)院單招職業(yè)適應(yīng)性測試題庫參考答案
評論
0/150
提交評論