




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TheApplicationLayer–Part2ContentsTheWorldWideWeb(Section7.3)TheWorldWideWebIntroductionArchitecturalOverviewStaticWebDocumentsDynamicWebDocumentsHTTP–TheHyperTextTransferProtocolIntroductionTheWorldWideWebisanarchitecturalframeworkforaccessinglinkeddocumentsspreadoutovermillionsofmachinesallovertheInternet.TheWeb(alsoknownasWWW)beganin1989atCERN,theEuropeancenterfornuclearresearch.In1994,CERNandM.I.T.signedanagreementsettinguptheWorldWideWebConsortium(sometimesabbreviatedasW3C),anorganizationdevotedtofurtherdevelopingtheWeb,standardizingprotocols,andencouraginginteroperabilitybetweensites.Theconsortium'shomepageisat
Introduction(2)Fromtheusers'pointofview,theWebconsistsofavast,worldwidecollectionofdocumentsorWebpages,oftenjustcalledpagesforshort.Eachpagemaycontainlinkstootherpagesanywhereintheworld.Theideaofhavingonepagepointtoanother,nowcalledhypertext,wasinventedbyavisionaryM.I.T.professorofelectricalengineering,VannevarBush,in1945,longbeforetheInternetwasinvented.Introduction(3)Pagesareviewedwithaprogramcalledabrowser,ofwhichInternetExplorerandNetscapeNavigatoraretwopopularones.Thebrowserfetchesthepagerequested,interpretsthetextandformattingcommandsonit,anddisplaysthepage,properlyformatted,onthescreen.Stringsoftextthatarelinkstootherpages,calledhyperlinks,areoftenhighlighted,byunderlining,displayingtheminaspecialcolor,orboth.(a)AWebpage(b)Thepagereachedbyclickingon
DepartmentofAnimalPsychology.ArchitecturalOverviewThepartsoftheWebmodel.PagesarenamedusingURLs(UniformResourceLocators).URL(UniformResourceLocators)PagesarenamedusingURLs(UniformResourceLocators).AtypicalURLis
/products.htmlaURLhasthreeparts:thenameoftheprotocol(http),theDNSnameofthemachinewherethepageislocated(),and(usually)thenameofthefilecontainingthepage(products.html).ArchitecturalOverview(2)WebpagesarewritteninastandardizedlanguagecalledHTML,whichdescribesWebpages.Webpagescanalsocontainicons,linedrawings,maps,andphotographs.Eachofthesecan(optionally)belinkedtoanotherpage.NotallpagescontainHTML.ApagemayconsistofaformatteddocumentinPDFformat,aniconinGIFformat,aphotographinJPEGformat,asonginMP3format,avideoinMPEGformat,oranyoneofhundredsofotherfiletypes.Whenaserverreturnsapage,italsoreturnssomeadditionalinformationaboutthepage.ThisinformationincludestheMIME
typeofthepage.TheClientSide(a)Abrowserplug-in.(b)Ahelperapplication.IftheMIMEtypeisnotoneofthebuilt-inones,thebrowserconsultsitstableofMIMEtypestotellithowtodisplaythepage.ThistableassociatesaMIMEtypewithaviewer.Therearetwopossibilities:plug-insandhelperapplications.TheServerSideAmultithreadedWebserverwithafrontendandprocessingmodules.URLs–UniformResourceLocatersSomecommonURLs.URLshavethreeparts:theprotocol(alsoknownasthescheme),theDNSnameofthemachineonwhichthepageislocated,andalocalnameuniquelyindicatingthespecificpage(usuallyjustafilenameonthemachinewhereitresides).StatelessnessandCookies(1)RequirementsSomeWebsitesrequireclientstoregister(andpossiblypaymoney)tousethem.Thisraisesthequestionofhowserverscandistinguishbetweenrequestsfromregisteredusersandeveryoneelse.E-commerce:howdoestheserverkeeptrackofthecontentsofthecart?CustomizedWebportalssuchasYahoo.StatelessnessandCookies(2)SolutionWhenaclientrequestsaWebpage,theservercansupplyadditionalinformationalongwiththerequestedpage.Thisinformationmayincludeacookie,whichisasmall(atmost4KB)file(orstring).Browsersstoreofferedcookiesinacookiedirectoryontheclient'sharddiskunlesstheuserhasdisabledcookies.Acookiemaycontainuptofivefields:Domain,Path,Content,Expires,Secure
JustbeforeabrowsersendsarequestforapagetosomeWebsite,itchecksitscookiedirectorytoseeifanycookiestherewereplacedbythedomaintherequestisgoingto.Ifso,allthecookiesplacedbythatdomainareincludedintherequestmessage.Whentheservergetsthem,itcaninterpretthemanywayitwantsto.StatelessnessandCookies(3)Someexamplesofcookies.StaticWebDocumentsInthesimplestform,Webpagesarestatic,thatis,arejustfilessittingonsomeserverwaitingtoberetrieved.HTML—TheHyperTextMarkupLanguageWebpagesarecurrentlywritteninalanguagecalledHTML.FormsFormscontainboxesorbuttonsthatallowuserstofillininformationormakechoicesandthensendtheinformationbacktothepage'sowner.XMLandXSL
HTML,withorwithoutforms,doesnotprovideanystructuretoWebpages.Italsomixesthecontentwiththeformatting.theW3ChasdevelopedanenhancementtoHTMLtoallowWebpagestobestructuredforautomatedprocessing.Twonewlanguageshavebeendevelopedforthispurpose.XML(eXtensibleMarkupLanguage)describesWebcontentinastructuredwayandsecond,XSL(eXtensibleStyleLanguage)describestheformattingindependentlyofthecontent.HTML-TheHyperTextMarkupLanguageHTMLallowsuserstoproduceWebpagesthatincludetext,graphics,andpointerstootherWebpages.HTMLisamarkup
language,alanguagefordescribinghowdocumentsaretobeformatted.Theadvantageofamarkuplanguageoveronewithnoexplicitmarkupisthatwritingabrowserforitisstraightforward:thebrowsersimplyhastounderstandthemarkupcommands.AWebpageconsistsofaheadandabody,eachenclosedby<html>and</html>tags(formattingcommands),althoughmostbrowsersdonotcomplainifthesetagsaremissing.Thestringsinsidethetagsarecalleddirectives.Sometagshave(named)parameters,calledattributes.HTML–HyperTextMarkupLanguage(a)TheHTMLforasampleWebpage.HTML–HyperTextMarkupLanguage(b)Theformattedpage.AselectionofcommonHTMLtags.somecanhaveadditionalparameters.HTMLVersionsHTMLkeepsevolving.HTML1.0andHTML2.0didnothavetables,buttheywereaddedinHTML3.0.AnHTMLtableconsistsofoneormorerows,eachconsistingofoneormorecells.Cellscancontainawiderangeofmaterial,includingtext,figures,icons,photographs,andevenothertables.Cellscanbemerged,so,forexample,aheadingcanspanmultiplecolumns.(a)AnHTMLtable.(b)Apossiblerenditionofthistable.(a)TheHTMLforanorderform.(b)TheformattedpageApossibleresponsefromthebrowsertotheserverwithinformationfilledinbytheuser.XMLandXSLHTML,withorwithoutforms,doesnotprovideanystructuretoWebpages.Italsomixesthecontentwiththeformatting.Ase-commerceandotherapplicationsbecomemorecommon,thereisanincreasingneedforstructuringWebpagesandseparatingthecontentfromtheformatting.
Forthisreason,theW3ChasdevelopedanenhancementtoHTMLtoallowWebpagestobestructuredforautomatedprocessing.Twonewlanguageshavebeendevelopedforthispurpose.XML(eXtensibleMarkupLanguage)describesWebcontentinastructuredwayXSL(eXtensibleStyleLanguage)describestheformattingindependentlyofthecontentAsimpleWebpageinXML.AstylesheetinXSL.DynamicWebDocumentsInrecentyears,moreandmorecontenthasbecomedynamic,thatis,generatedondemand,ratherthanstoredondisk.Contentgenerationcantakeplaceeitherontheserversideorontheclientside.Server-SideDynamicWebPageGenerationCGI(CommonGatewayInterface)JSP(JavaServerPages),ASP(ActiveServerPages),Client-SideDynamicWebPageGenerationJavaScriptappletsActiveXcontrolsServer-SideDynamicWebPageGenerationStepsinprocessingtheinformationfromanHTMLform.Server-SideDynamicWebPageGeneration(2)AsampleHTMLpagewithembeddedPHP(HypertextPreprocessor)AlthoughPHPiseasytouse,itisactuallyapowerfulprogramminglanguageorientedtowardinterfacingbetweentheWebandaserverdatabase.Server-SideDynamicWebPageGeneration(3)WehavenowseentwodifferentwaystogeneratedynamicHTMLpages:CGIscriptsandembeddedPHP.Thereisalsoathirdtechnique,calledJSP(JavaServerPages),whichissimilartoPHP,exceptthatthedynamicpartiswrittenintheJavaprogramminglanguageinsteadofinPHP.Afourthtechnique,ASP(ActiveServerPages),isMicrosoft'sversionofPHPandJavaServerPages.ItusesMicrosoft'sproprietaryscriptinglanguage,VisualBasicScript,forgeneratingthedynamiccontent.Client-SideDynamicWebPageGenerationCGI,PHP,JSP,andASPscriptssolvetheproblemofhandlingformsandinteractionswithdatabasesontheserver.ItisnecessarytohavescriptsembeddedinHTMLpagesthatareexecutedontheclientmachineratherthantheservermachine.StartingwithHTML4.0,suchscriptsarepermittedusingthetag<script>.ThemostpopularscriptinglanguagefortheclientsideisJavaScript.JavaScriptisascriptinglanguage,verylooselyinspiredbysomeideasfromtheJavaprogramminglanguage.ItisdefinitelynotJava.UseofJavaScriptforprocessingaform.(a)Server-sidescriptingwithPHP.(b)Client-sidescriptingwithJavaScript.JavaScriptJavaScriptisafull-blownprogramminglanguage,withallthepowerofCorJava.Ithasvariables,strings,arrays,objects,functions,andalltheusualcontrolstructures.ItalsohasalargenumberoffacilitiesspecificforWebpages,includingtheabilitytomanagewindowsandframes,setandgetcookies,dealwithforms,andhandlehyperlinks.JavaScriptcanalsotrackmousemotionoverobjectsonthescreen.ManyJavaScriptWebpageshavethepropertythatwhenthemousecursorismovedoversometextorimage,somethinghappens.AppletsJavaScriptisnottheonlywaytomakeWebpageshighlyinteractive.Anotherpopularmethodisthroughtheuseofapplets.AppletsaresmallJavaprogramsthathavebeencompiledintomachineinstructionsforavirtualcomputercalledtheJVM(JavaVirtualMachine).AppletscanbeembeddedinHTMLpages(between<applet>and</applet>)andinterpretedbyJVM-capablebrowsers.Microsoft'sanswertoSun'sJavaappletswasallowingWebpagestoholdActiveXcontrols,whichareprogramscompiledtoPentiummachinelanguageandexecutedonthebarehardware.Client-SideDynamicWebPageGenerationThevariouswaystogenerateanddisplaycontent.HTTP—TheHyperTextTransferProtocol
HTTP(Hy
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 斜面小车滑板项目投资可行性研究分析报告(2024-2030版)
- 农业产品销售代理合同协议书范文
- 2024届湖南省湘西古丈县重点中学中考冲刺卷数学试题含解析
- 2024届黄山市重点中学毕业升学考试模拟卷数学卷含解析
- 2025投资项目可行性研究报告目录
- 人教版七年级上册英语语法总结范文
- 2025-2030中国电子健康记录(EHR)软件行业市场现状供需分析及投资评估规划分析研究报告
- 2025-2030中国电动汽车用轮胎行业市场现状分析及竞争格局与投资发展研究报告
- 2025-2030中国瑜伽服市场需求现状调研及未来营销趋势研究报告
- 2025-2030中国牙科文件行业市场现状供需分析及投资评估规划分析研究报告
- 中班语言学习活动优化计划
- 玻璃体积血的治疗
- 2025年货物购销合同范本
- 2025年教育管理与政策研究考试试题及答案
- 2025届北京市北京一零一中学生物七下期末质量检测试题含解析
- 2025Q1 BrandOS出海品牌社媒影响力榜单-OneSight
- 2025陕西延安通和电业有限责任公司供电服务用工招聘103人笔试参考题库附带答案详解
- 《生成式人工智能职业技能评估规范》
- 颁奖礼仪队培训体系
- 2025年新媒体运营专员面试题及答案
- 心血管-肾脏-代谢综合征患者的综合管理中国专家共识2025解读-1
评论
0/150
提交评论