




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
共17页第17-页Intraditionalsupplychaininventorymanagement,ordersaretheonlyinformationfirmsexchange,butinformationtechnologynowallowsfirmstosharedemandandinventorydataquicklyandinexpensively.Westudythevalueofsharingthesedatainamodelwithonesupplier,Nidenticalretailers,andstationarystochasticconsumerdemand.Thereareinventoryholdingcostsandback-orderpenaltycosts.Wecompareatraditionalinformationpolicythatdoesnotusesharedinformationwithafullinformationpolicythatdoesexploitsharedinformation.Inanumericalstudywefindthatsupplychaincostsare2.2%loweronaveragewiththefullinformationpolicythanwiththetraditionalinformationpolicy,andthemaximumdifferenceis12.1%.Wealsodevelopasimulation-basedlowerboundoverallfeasiblepolicies.Thecostdifferencebetweenthetraditionalinformationpolicyandthelowerboundisanupperboundonthevalueofinformationsharing:Inthesamestudy,thatdifferenceis3.4%onaverage,andnomorethan13.8%.Wecontrastthevalueofinformationsharingwithtwootherbenefitsofinformationtechnology,fasterandcheaperorderprocessing,whichleadtoshorterleadtimesandsmallerbatchsizes,respectively.Inoursample,cuttingleadtimesnearlyinhalfreducescostsby21%onaverage,andcuttingbatchesinhalfreducescostsby22%onaverage.Forthesettingswestudy,weconcludethatimplementinginformationtechnologytoaccelerateandsmooththephysicalflowofgoodsthroughasupplychainissignificantlymorevaluablethanusinginformationtechnologytoexpandtheflowofinformation.Inventorymanagementisacommercialenterprisemanagementofthecoreareas,Enterprisescanalsoachieveaneffectivekey,ifwecanachievefromthepurchaseofstock,Salesthentheentireflowofgoodsandcapitalflowsituationfortheunifiedmanagementandreasonableproduction,timelysalesandinventoryisthesmallest.reducethebacklogofmaterial,thenthebusinesswillachievethebestresults.1.sessionInmyexperience,sessionwordisprobablysecondonlytotheextentoftheabuseoftransaction,evenmoreinterestingisthetransactionandthesessioninthecontextofthemeaningofsomeofthesame.
session,theChineseoftentranslatedintothesession,itsoriginalmeaningreferstothebeginningsandendsofaseriesofaction/information,suchasaphonecallfromthedialtopickupthephonetohangupthemiddleoftheprocesscanbedescribedasaseriesofsession.Sometimeswecanseethatthecase"duringthesessioninabrowsersession,...",termusedhereisitsoriginalmeaning,isopenfromabrowserwindowtoclosetheperiodof①.Themostconfusingisthe"user(client)duringthefirstsession,"thewords,itmayrefertoaseriesofuseractions(generallywithaspecificpurposerelatedtoaseriesofactions,suchaslogontobuygoodsfromtosignoutsuchanonlineshoppingcheckoutprocess,sometimesalsocalledatransaction),butsometimesmaybejustthataconnectioncouldalsobethatthemeaningof①,thedifferencecanonlybeinferredbycontext②.
However,whenthetermsessionisassociatedwiththenetworkprotocolwhenitoftenimpliesa"connection-oriented"and/or"onhold"sothetwomeanings,"connection-oriented"referstoboththecommunicationinthecommunicationpriortofirstestablishacommunicationchannel,suchasphonecalls,untiltheotherpartyansweredthephonecommunicationcanbegin,andthisistheoppositeofwriting,beforeyousenttheletter,thetimeyouandcannotconfirmtheothersideoftheaddressiscorrect,communicationchannelsBuyiDingcanbeestablished,butthesender,thecommunicationhasalreadybegun."Keepstate"meansthecommunicationpartyisabletoassociateaseriesofmessages,makingmessagesbetweeneachotherdepends,forexample,awaitercanrecognizeoldcustomerscomebackandrememberthelasttimethecustomerstillowesastore,dollar.Examplesofthistype,"aTCPsession"or"aPOP3session"③.
Andtothewebserverflourishing,sessioninthecontextofsemanticwebdevelopmenthasanewexpansion,itsmeaningismeantotheclientandservertomaintainstatebetweenthesolution④.Sessionisalsosometimesusedtorefertosuchsolutions,storagestructures,such"storedinthesessiontoxxxwhere"⑤.Forvarious用于webdevelopmentlanguagesareavailabletosomeextentonthesupportofsuchasolution,sointhecontextofaparticularlanguage下,sessionalsousedtodenoteasolutiononbehalfofthelanguage,suchasregularJavaintheprovisionofjavax.servlet.http.HttpSessionreferredtoasthesession⑥.
Inviewofthisconfusionhasbeenchanged,inthisarticleusethetermsessionwillhavedifferentmeaningsdependingonthecontext,drewattentiontotheresolution.
Inthisarticle,theuseofChinese"duringthebrowsersession,"toconveythemeaningof①,use"sessionmechanism"toconveythemeaning④,usethe"session"expressionmeaning⑤,usespecific"HttpSession"toconveythemeaning⑥Second,HTTPprotocolandthestatetomaintain
HTTPprotocolitselfisstateless,HTTPprotocolwhichisconsistentwiththeoriginalpurposeoftheclientonlyneedsasimplerequesttodownloadsomefileserver,eithertheclientortheservernothavebeennecessaryrecordsofpastbehaviortoeachother,andeachtimebetweentherequestareindependent,likeacustomerandavendingmachineoranordinary(non-membership)astherelationshipbetweensupermarkets.
However,smart(orgreedy?)Peoplesoondiscoveredthatiftheycanprovideon-demandgenerationofdynamicwebinformationwillbecomemoreuseful,likeacableTVwithon-demandthesamefunction.ThisdemandontheonehandtoforcegraduallyaddHTMLform,script,DOMandotherclient-sidebehavior,ontheotherhandthereistheserver-sideCGIpracticestorespondtoclient-sidedynamicrequest,theHTTPprotocolasthetransportcarrieralsoaddedafileupload,cookiethesecharacteristics.TherolewhichcookieistosolvethestatelessHTTPprotocoleffortsdefects.Asforthesubsequentemergenceofthesessionmechanismisyetanotherinbetweentheclientandtheserverstatesolution.
Letususesomeexamplestodescribethesessioncookieandthedifferencesandsimilaritiesbetweenthemechanisms.Ioncefrequentedacoffeeshopwithfreegiftstodrinkfivecupsofcoffeeoffersacupofcoffee,butaone-timeconsumptionoffivecupsofcoffeeisremote,thenneedawaytorecordacustomer'sconsumption.Imaginethatinfactnothinglessthanthefollowingseveraloptions:
1,thestore'sstaffisverypowerful,abletoremembereachcustomer'sconsumption,aslongascustomersenteredthecafe,shopassistantsknowhowtodealwiththe.Thisapproachistheagreementitselftosupportthestate.
2,issuecustomersacardrecordingthenumberofconsumersingeneralhaveavalidityperiod.Eachconsumer,ifthiscardisproduced,thentheconsumerwillbewiththeconsumerbeforeorafterlinkingup.Thisapproachismaintainedintheclientstate.
3,amembershipcardissuedtocustomers,inadditiontoanyinformationoutsidethecardnumberisnotrecorded,eachconsumer,ifthecardisproduced,thentherecordsclerkinthestoretofindthecardnumbercorrespondstotherecordtoaddsomeconsumerinformation.Thisapproachismaintainedintheserver-sidestate.
AstheHTTPprotocolisstateless,butduetovariousconsiderationsdonotwanttobecomeastate,therefore,thelasttwoprogramshasbecomearealisticoption.Specificallycookiemechanismisusedtomaintainstateoftheclientprogram,whichusesasessionmechanismtomaintainstateintheserver-sideprogram.Wealsoseethat,thankstoserver-sidemaintainstateoftheprogramincustomerclientbutalsoXuyaobaocunalogo,somechanismsmayneedthehelpofsessioncookiemechanismtoidentifythepurposeofDaDaosaved,itactuallyalternativesareavailable.Third,thecookiemechanism
Thebasicprinciplecookiemechanismassimpleastheaboveexample,butthereareseveralissuestoresolve:"membershipcard"howtodistribute;"membershipcard"ofthecontent;andcustomershowtousethe"MemberCard."
OrthodoxcookiedistributionisbyextendingtheHTTPprotocoltoachieve,andtheserverthroughtheHTTPresponseheaderwithalineofspecialinstructionstopromptthebrowserinaccordancewiththeinstructionsgeneratesthecorrespondingcookie.Butpureclient-sidescriptingsuchasJavaScriptorVBScriptcanalsogeneratethecookie.
Thecookieusedbythebrowserinthebackgroundaccordingtocertainprinciplesautomaticallysenttotheserver.Checkallstoredbrowsercookie,ifacookieisgreaterthanorequalscopestatementwillbethelocationoftherequestedresources,puttheresourcesoftheHTTPrequestcookieattachedtotheheadsenttherequesttotheserver.MeansthatMcDonald'smembershipcardcanonlybeproducedintheMcDonald'sstore,ifastorehasalsoissueditsownmembershipcard,thenenterthestorewhentheadditiontoproduceMcDonald'smembershipcard,butalsotoproduceamemberofthestorecard.
cookie'scontentsinclude:name,values,expirationtime,pathanddomain.
Youcanspecifyadomaininwhichadomainsuchas.G,theequivalentofmainstoresigns,suchasProcter&Gamble,youcanalsospecifyaspecificdomainofamachineundersuchor,canfloatFlexibilitytodothan.
PathisthenamebehindtheURLwiththepath,suchas/or/foo,etc.,candomorethanacounterRejoice.
Pathtogetherwiththedomainconstitutesacookie'sscope.
Ifyoudonotsettheexpirationtime,thenthelifetimeofthiscookietothebrowserduringthesession,simplyclosethebrowserwindow,cookiedisappears.Thisperiodoflifeofthecookiebrowsersessioniscalledsessioncookie.Sessioncookieisgenerallynotstoredontheharddiskbutkeptinmemory,ofcourse,providedthatitisnotstandardized.Ifyousettheexpirationtime,thebrowserthecookiewillbesavedtotheharddisk,openagainafterclosingthebrowser,thecookieisstillvaliduntiltheexpirationtimeexceedsaset.
Storedinacookieonyourharddiskinadifferentbrowser,sharedbetweenprocesses,suchasthetwoIEwindows.Andstoredinmemoryforthecookie,differentbrowsershavedifferentapproaches.ForIE,openwindowsinapressCtrl-N(orfromtheFilemenu)toopenthewindowcanbesharedwiththeoriginalwindowwhileusingothermeanstoopentheIEprocesswillnothavetoopenthewindowssharedmemorycookie;forMozillaFirefox0.8,alloftheprocessandcansharethesametabthecookie.Ingeneralisthewindow.openjavascriptwindowwillopenwiththeoriginalwindowssharedmemorycookie.Browser,thiscookieforthesessioncookiedoesnotbelievethatpeopleonlyrecognizetheapproachtotheuseoftheregularsessionofwebapplicationdevelopmentmechanismcausinggreatdistress.
Hereisagoolgesetcookieresponseheaderexample
HTTP/1.1302Found
Location:/intl/zh-CN/
Set-Cookie:PREF=ID=0565f77e132de138:NW=1:TM=1098082649:LM=1098082649:S=KaeaCFPo49RiA_d8;expires=Sun,17-Jan-203819:14:07GMT;path=/;domain=.
Content-Type:text/html
ThisistheuseofHTTPLooktheHTTPSnifferHTTPcommunicationssoftwaretocapturethepartoftherecord
Goolgebrowsertoaccesstheresourcesagain,automaticallysendoutcookie
UseFirefoxcaneasilyobservethecurrentvalueofcookie
UseHTTPLookwithFirefoxcookiecaneasilyunderstandtheworkingprinciple.
IEcanbesettoaskbeforeacceptingcookie
Thisisadialogboxaskingtoacceptcookie.
Fourth,understandthesessionmechanism
mechanismisaserver-sidesessionmechanism,theserverusesahashtableissimilartothestructure(andprobablyistouseahashtable)tosavetheinformation.
Whentheprogramneedsforaclient'srequesttocreateasessionwhentheserverfirstcheckstheclient'srequestisincludedinasessionID-knownasthesessionid,ifthedescriptioncontainsasessionidforthisclientpreviouslyCreateoversession,theserverinaccordancewiththesessionidtoretrievethesessionoutoftheuse(ifnotretrieved,maybethenewone),iftheclientrequestdoesnotincludesessionid,thencreateasessionforthisclientandgenerateasessionwiththisassociatedwiththesessionid,sessionidvalueshouldbeanotonlywillnotrepeat,noteasytofindthelawtocopythestring,thesessionidtobereturnedinthisresponsetotheclientsaved.
Savethesessionidofthewaystousecookie,sotheinteractionofthebrowsercanautomaticallyidentifythisplaybytherulestotheserver.ThenameofthiscookiearegenerallysimilartoSEEESIONID,and.Forexample,webapplicationsweblogicgeneratedcookie,JSESSIONID=ByOK3vjFD75aPnrF7C2HmdnV6QZcEbzWoWiBYEnLerjQ99zWpBng!-145788764,ItsnameisJSESSIONID.
Asthecookiecanbeartificiallyprohibited,theremustbeothermechanismstobebannedinthecookiewhenthesessionidstillbeabletopassbacktotheserver.OftenuseatechniquecalledURLrewriting,thesessionidisattachedtotheURLpathdirectlybehind,therearetwoadditionalways,oneistheURLpathasadditionalinformation,showingtheformofhttp://...../xxx;jsessionid=ByOK3vjFD75aPnrF7C2HmdnV6QZcEbzWoWiBYEnLerjQ99zWpBng!-145788764
TheotherisasaURLquerystringappendedtotheback,showingtheformofhttp:///xxx?jsessionid=ByOK3vjFD75aPnrF7C2HmdnV6QZcEbzWoWiBYEnLerjQ99zWpBng!-145788764
Bothwaysisnodifferentforusers,andonlyaserverparsingthetimetodealwiththedifferentways,usingthefirstwaysareconducivetoturningonekindofsessionid'sinformationandtodistinguishnormalprogramparameters.
WeiLiaoZaitheinteractionalwaysmaintainstate,wemusteachclientmayrequestapathtotherearofcontainingthissessionid.
Anothertechniqueknownashiddenformfields.Isthattheserverwillautomaticallymodifytheform,addahiddenfield,sowhentheformissubmittedtothesessionidpassedbacktotheserver.Example,thefollowingform
<formname="testform"action="/xxx">
<inputtype="text">
</Form>
Beingpassedtoclientwillberewrittenbefore
<formname="testform"action="/xxx">
<inputtype="hidden"name="jsessionid"value="ByOK3vjFD75aPnrF7C2HmdnV6QZcEbzWoWiBYEnLerjQ99zWpBng!-145788764">
<inputtype="text">
</Form>
Applicationofthistechnologyisnowless,IcontactedtheveryoldiPlanet6(SunONEApplicationServer'spredecessor)ontheuseofthistechnology.
InfactthistechnologycansimplyapplytotheactionURLrewritinginstead.
Whentalkingaboutthesessionmechanism,oftenheardofsuchamisunderstanding,"aslongasthebrowserisclosed,sessiondisappears."Infact,imaginetheexamplecard,unlessthecustomertomakesalesonthestorecard,otherwisethestorewouldnoteasilyremovethecustomerinformation.Thisisalsotrueofthesession,unlesstheproceduretoinformtheservertodeleteasession,otherwisetheserverwillremainontheprogramaregenerallydoneintheuserlogoffwhenthesendacommandtodeletethesession.However,thebrowserwillnevertaketheinitiativetonotifytheserverwillbeshutoff,sotheserverwillnothavetheopportunitytoknowthebrowserhasbeenthereasonwhythereissuchamisconception,themajorityofsessionmechanismtouseasessioncookietostorethesessionidandcloseyourbrowserthesessionidisgone,onceagainconnecttotheserverwillnotbeabletofindwhentheoriginalsession.Iftheservercookiesettingsaresavedtotheharddisk,orusesomemeanstorewritethebrowser'sHTTPrequestheadersenttotheoriginalsessionidsenttotheserver,thenre-openthebrowsercanstillfindtheoriginalsession.
Itispreciselybecauseoftheclosuredoesnotcausethebrowsersessionisdeleted,forcingserverseesionsetupafailuretime,asthedistancebetweenthefirstuseoftheclientsessionformorethanthefailuretime,theserverthattheclienthasceaseditsactivities,thesessionwillbedeletedtosavestoragespace.
5,javax.servlet.http.HttpSession
HttpSessionsessionmechanismistheJavaplatformimplementationofnorms,becauseitisonlytheinterface,specifictoeachwebapplicationserverproviders,inadditiontostandardsupport,therewillstillbenorequirementofsomenormsinthenuances.HerewearewithBEA'sWeblogicServer8.1asanexampletodemonstrate.
Firstofall,WeblogicServerprovidesasetofparameterstocontrolitsHttpSessionimplementation,includingtheuseofcookieswitchoptiontouseURLrewritingswitches,sessionpersistencesettings,sessionfailuretimesetting,aswellasforthecookieavarietyofsettings,suchassetcookiename,path,domain,cookiesurvivaltime.
Ingeneral,sessionarestoredinmemory,whentheprocessisstopped,orrestarttheserverwhenthememoryofthesessionwillalsobeempty,ifyousetthesessionpersistencefeature,theserverwillsavethesessiontoyourharddriveWhentheserverprocessrestartortheinformationcanbeusedagain,WeblogicServersupportssustainablemannerincludingdocuments,databases,client-sidecookiepreservationandreproduction.
Strictlyspeakingnotapersistentcopysaved,becausethesessionisactuallystoredinmemory,butthesameinformationisreplicatedtoeachserverprocesswithinthecluster,soevenifaserverprocesstostopworkingandstillavailablefromotherprocessesobtainsession.
cookiesettingswillaffectthesurvivaltimeofthebrowsergeneratesasessioncookieisacookie.Thedefaultistouseasessioncookie.Interestedcanuseittotestusinthefourthquarter,asmentionedinthemisunderstanding.
cookiepathforthewebapplicationisaveryimportantoption,WeblogicServeronthedefaulthandlingofthisoptionmakesitsignificantlydifferentfromotherservers.Wewilldiscussthetopiclater.
Settingsonthesessionreference[5]/wls/docs70/webapp/weblogic_xml.html#1036869
6,HttpSessionFrequentlyAskedQuestions
(Inthissectiontheimplicationsforthesessionmixed⑤and⑥)
1,sessioniscreatedwhen
Acommonmisconceptionisthatthesessioninaclientvisit,wascreated,butthefactisthatuntilaserver-sideprogramcalledHttpServletRequest.getSession(true)whensuchastatementiscreated,notethatiftheJSPdoesnotappeartouse<%@pagesession="false"%>closedsession,theJSPfilewillbeautomaticallycompiledintoaServletwhentheinclusionofsuchastatementHttpSessionsession=HttpServletRequest.getSession(true);ThisisalsoimpliedinJSPsessionobjectorigin.
Asthesessionwillconsumememoryresources,soifyoudonotintendtousethesession,alltheJSPshouldbeturnedoffit.
2,sessionisdeletedwhen
Comprehensivediscussionsearlier,gramcallsHttpSession.invalidate();orb.fromthelasttimebeforetheclientsendsthesessionidthantheintervalsessiontimeoutsettings;orc.serverprocessisstopped(non-persistentsession)
3,howtododeletethebrowserclosedsession
Strictlyspeaking,cannotdothis.Approachcandoalittleeffortisallclientsusethejavascript代码window.oncolosepagetomonitorthebrowser'sclosingmovement,andthensendtotheservertodeleteaQingqiusession.Butthecollapseorforcedtokillthebrowserprocessisstillpowerlesstheseunconventionalmeans.
4,thereishowthematterHttpSessionListener
Youcancreatesuchalistenertomonitorthesessioncreationanddestructionevents,sointheeventofsuchaneventyoucandosomerelevantwork.Notethatsessioncreationanddestructionofactiontriggerlistener,notthereverse.SimilartothelistenerwiththeHttpSessionalsoHttpSessionBindingListener,HttpSessionActivationListenerandHttpSessionAttributeListener.
5,storedinasessionoftheobjectmustbeserializableforyou
Notrequired.Requestedobjectscanbeserializedonlytosessionintheclustercanbecopiedorsavedtoalastingortemporary,wherenecessary,thesessionservercanexchangethememory.ThesessioninWeblogicServercannotbeplacedinaserializedobjectintheconsolewillreceiveawarning.IusedaiPlanetversioniftherecannotbeserializedsessionobjectsinthesessiontherewillbeadestructionofException,verystrange.
6,howtocorrectlydealwiththepossibilityoftheclientagainstcookie
TheURLforallURLrewritingtouse,includinghyperlinks,formofaction,andtheredirectionofURL,thespecificapproach,see[6]
/wls/docs70/webapp/sessions.html#100770
7,opentwobrowserwindowstoaccesstheapplicationwillusethesamesessionoradifferentsession
Seethediscussionofthethirdsectionofthecookie,thesessionidisnotonlytherecognitionofidentification,sodifferentbrowsers,differentmethodsanddifferentwindowsopenthecookieisstoredwillaffecttheanswertothisquestion.
8,howtopreventtheusertoopentwobrowserwindowsoperatingsessionduetoconfusion
Thisissueistopreventmultiplesubmitsofsimilarform,youcansettosolvetheclient'stoken.Isgeneratedeachtimetheserverreturnsadifferentidtotheclient,whilepreservingthesession,theclientsubmitstheformmustalsoreturntheidserver,theprogramfirstcomparesthereturnofidandthevaluestoredinthesessionarethesamein,andifnotthenexplainthisoperationhasbeensubmittedbefore.Cansee"J2EECoreModel"onthepartofthelayermodel.Notethattheuseofjavascriptwindow.opentoopenthewindow,generallydonotsettheid,oruseaseparateid,topreventthemainwindowdoesnotoperate,itisrecommendednottoopenthewindowwindow.openmakechangestooperations,sothatyoucannotset.
9,whychangethesessioninWeblogicServertore-callafterthevalueofasession.setValue
InordertodothisactionismainlyintheclusterenvironmentpromptedWeblogicServersessioninthevaluehaschanged,needtocopytootherserverprocessesthevalueofthenewsession.
10Whyisgonesession
Ruleoutthefailurefactors,thenormalsession,theserveritselfwillbeverylittlepossibility,althoughtheauthorplusanumberofpatchesiniPlanet6SP1Solarisversionhasfaceddown;thepossibilityofbrowserplug-second,Ialsoencountered3721plug-incausedproblems;theoryfirewallorproxyserverincookiehandlingcouldalsobeaproblem.
Mostofthereasonsforthisproblemoccurs,theerrorsarethemostcommonisanapplicationtoaccessanotherapplication.Wediscussthisissueinthenextsection.
7,cross-applicationsharingsession
Oftensuchasituation,alargeprojectdividedintoanumberofsmallprojectdevelopment,inordertobeabletointerferencefromeachother,requiresthateachsmallitemasaseparatewebapplicationdevelopment,buttosuddenlyfindthatlastbetweenafewsmallprojectsneedtosharesomeinformation,orwanttousethesessiontoachieveSSO(singlesignon),storedinthesessionloginuserinformation,themostnaturalrequirementisthatbetweenapplicationscanaccesseachother'ssession.
However,inaccordancewiththeServletSpecification,sessionofthecurrentscopeshouldbelimitedtoapplicationprocedures,betweenthedifferentapplicationscannotaccesseachother'ssessionofeachother.Eachapplicationserver,bothfromthepracticaleffectofcompliancewiththisspecification,butimplementationdetailsmightvary,sotoaddresscross-applicationsessiontosharethemethodsaredifferent.
Firstofall,lookattheTomcatwebapplicationishowtoachieveisolationbetweenthesession,fromTomcattosetthecookiepathofview,itsapplicationindifferentsetcookiepathisdifferent,sodifferentapplicationsusedbythesessionidisdifferent,soeveninthesamebrowserwindowaccessdifferentapplications,senttotheserver'ssessionidcanbedifferent.
Accordingtothisfeature,wecanspeculateTomcatinthesessionmemorystructureasfollows.
I'veusedtheiPlanetalsousedthesameway,itisestimatedbetweenSunONEandiPlanetwillnotbemuchdifference.Fortheserverthisway,theideaisverysimpletosolve,theactualpracticeitisnotdifficult.Orallapplicationssharingasessionid,orlettheapplicationaccesstootherapplicationssessionid.
iPlanetthereisaverysimplewaytoachievesharingasessionid,thatisthepathofeachapplicationofthecookiearesetto/(infactshouldbe/NASApp,fortheapplicationintermsofitsfunctionsastheroot).
<session-info>
<path>/NASApp</path>
</Session-info>
Notethattheoperationofsomesharedsessionshouldfollowtheprogrammingconventions,suchassessionattributenameprecededbytheprefixoftheapplication,makingsetAttribute("name","neo")intosetAttribute("","neo"),toavoidnamespaceconflicts,leadingtooverwriteeachother.
InTomcatthechoiceisnotsoeasy.IntheTomcatversion3,wealsohavesomemeanstosharethesession.Forversion4andaboveTomcat,nowIhavenotyetfoundasimpleway.Withonlythepowerofthirdparties,suchuseoffiles,databases,JMS,orclient-sidecookie,URLparameterorhiddenfieldsandothermeans.
Let'slookathowtohandlesessionWeblogicServeristhe.
FromthescreenshotyoucanseetheWeblogicServerscreenallapplicationstosetthecookiepathis/,thismeanthatthedefaultintheWeblogicServercansharethesessionout?However,evenasmallexperimentcanprovethatdifferentapplicationsusethesamesession,eachapplicationisstillonlyhaveaccesstohisownsetofthoseattributes.ThisshowsthattheWeblogicServerinthefollowingsessionofthememorystructuremay
Forsuchastructure,themechanismitselfinthesessiontoresolvetheproblemsharingsessionshouldbeimpossible.Inadditiontothepowerbymeansofathirdparty,suchasusingfiles,databases,JMS,orclient-sidecookie,URLparameterorhiddenfieldsandothermeans,thereisamoreconvenientapproachistoputaServletContextapplicationsession,sothatAnotherapplicationcanbeobtainedfromtheServletContextreferencetothepreviousapplication.Samplecodeisasfollows,
ApplicationA
context.setAttribute("appA",session);
ApplicationB
contextA=context.getContext("/appA");
HttpSessio
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 入股份制合同协议书
- 藏文安全文明常识考试题及答案
- 胸部体格检查试题及答案
- 校长公招试题及答案
- 家产合同协议书范本简单
- 2025年公共卫生应急物资资金申请政策效果跟踪报告
- 胸外科医生试题及答案
- 2025年能源与资源行业太阳能光伏发电技术发展趋势报告
- 2025年便利店新零售模式下的物流配送体系升级报告
- 数控机床智能化升级技术路径解析:2025年行业效益提升策略研究
- Unit 6 Section A 1a-2c 说课课件2024-2025学年人教版英语八年级下册
- 2024年中国养老产业商学研究报告-银发经济专题
- 保卫管理员三级练习题
- DBJ51T033-2014 四川省既有建筑电梯增设及改造技术规程
- 武昌实验中学2025届高三下第一次测试数学试题含解析
- 养老护理员培训课程内容(范本)
- 大模型原理与技术-课件 chap10 多模态大模型
- 工地司机安全培训
- 高教版2023年中职教科书《语文》(基础模块)下册教案全册
- 义务教育版(2024)四年级全一册-第三单元第11课-嘀嘀嗒嗒的秘密-教案
- 《采气树基础知识》课件
评论
0/150
提交评论