欢迎来到天天文库
浏览记录
ID:6634727
大小:39.50 KB
页数:13页
时间:2018-01-20
《外文文献—asp3.0和iis5.0的新特性》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、外文资料ASP3.0&IIS5.0'newCharacteristicpropertyOneofthemostexcitingnewfeaturesinASP3.0andIIS5.0istheintroductionofprogrammableserversideredirection.Whatthismeansisthat,finally,wecantransfercontrolandexecutionofapagetoanotheronewithouthavingtobothertheclientbyusingRe
2、sponse.Redirect.We'llseewhatwemeanbythisnext.TheProblemswithClient-sideRedirectionASPprogrammersregularlyusetheResponse.Redirectstatementtoloadadifferentpagetotheonethatiscurrentlyexecuting.However,manydon'trealizethatthisdoesn'tautomaticallycausetheservertoimme
3、diatelyloadandexecutethenewpage.WhatitactuallydoesisaddanHTTPredirectionheadertotheoutputstreambeingsentfromtheWebservertotheclient.Thisheaderlookssomethinglikethis:HTTP/1.1302ObjectMovedLocationnewpage.aspThestandardHTTPstatusmessageinthisheader,302ObjectMoved,
4、tellsthebrowserthattheresourcetheyrequestedhasmoved.TheLocationheaderprovidestheaddressofthepagetheywant.Ofcoursethisdoesn'thavetobethereality–whatwe'redoingisfoolingthebrowserintothinkingthatthepagetheywantcanbefoundatadifferentlocation.Whatisactuallyhappeningi
5、sthatourserverisexecutingthepagetheyrequested,butistellingthemthatthepagetheywanthasmoved.ThisiswhywehavetoexecutetheRedirectmethodbeforewesendanypagecontenttothebrowser.Whenabrowserreceivesthe302ObjectMovedmessageitrespondsbycancelingthecurrentrequestandsending
6、anewrequestforthepagespecifiedintheLocationvalue.ThisworksinjustthesamewayaswhenweuseaMETAHTTP-EQUIVtaginthe
7、heclient,notonourserver.Whilethisisn'tgenerallyaproblem,itcancausespuriousmessagestobedisplayedifthereisaproxyserverinuseattheclientendoftheconnection.Theproxyserverwillusuallyinterceptthestatusmessageandmayitselfgenerateapagethatissentontotheclientthatmadetheor
8、iginalrequest.ThisiswhytheubiquitousandannoyingmessageTheobjectyourequestedhasbeenmovedandcanbefoundhereisoftendisplayedontheclientwhenweuseResponse.Redirect,although
此文档下载收益归作者所有