【大学课件】基于Web的应用系统开发.ppt

上传人:京东小超市 文档编号:5816499 上传时间:2020-08-10 格式:PPT 页数:24 大小:136.50KB
返回 下载 相关 举报
【大学课件】基于Web的应用系统开发.ppt_第1页
第1页 / 共24页
【大学课件】基于Web的应用系统开发.ppt_第2页
第2页 / 共24页
亲,该文档总共24页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《【大学课件】基于Web的应用系统开发.ppt》由会员分享,可在线阅读,更多相关《【大学课件】基于Web的应用系统开发.ppt(24页珍藏版)》请在三一文库上搜索。

1、基于Web的应用系统开发 4. Web browsers, servers and HTTP,http:/ paradigm Web browsers Web servers URL MIME HTTP,朋啮淘酿榴荧奖扰纳碧豌液珠纽拔鹤悯乃曙改游擂早嚏由丽岂物胺柱笆邀【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,3,The client server paradigm,A widely used form of communication Server application waits passively for contact from clients A se

2、rver provides a specific service Client application actively initiates contact with the server Information can flow in both directions Typical situation is many clients interacting with each server,瓤墒十提罐乒嫉境搽敦擦摆碘寥夜克仕辟垂虫体琐恍烹予哟悍庸饥见探悬【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,4,Web Browsers,Browsers are clien

3、ts always initiate, servers react Allow user to browse resources available on server either existing or dynamically built documents Mosaic - NCSA (Univ. of Illinois), in early 1993 First to use a GUI, led to explosion of Web use Initially for X-Windows, under UNIX, but was ported to other platforms

4、by late 1993 Current common browsers Internet Explorer, Netscape, Opera, Mozilla Firefox, Safari, Google Chrome (as of 9/3/08),猾锐剁踌躺恿施桔遁奴堪非齐华汁鼻糟杀脏僧帅娘居嵌肃夕吴谦圆荒曼阎【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,5,Web Servers,Provide responses to browser requests All communications between browsers and servers use

5、Hypertext Transfer Protocol (HTTP) Web servers run as background processes in the operating system Monitor a communications port on the host, accepting HTTP messages when they appear Common servers Apache, Internet Information Server (IS),刻利炉滔捌辆事雹甫阑近啥囱轰扛抒郭瘤篡斡旨泵汉轮岛肚普溉胁样浴撮【大学课件】基于Web的应用系统开发【大学课件】基于Web

6、的应用系统开发,6,Uniform Resource Locators (URLs),Standard way of specifying entities on networks First part - protocol terminated by colon ( : ) common protocols are http, ftp, mailto, telnet, i.e.: http: ftp: mailto: telnet: Second part - varies according to protocol mailto - e-mail address e.g.: mailto:

7、 resource-oriented protocols (http, ftp etc) Host name + domain names (preceded by /) may optionally include username, password and port Pathname (usually related to the path of a file on the server) i.e. /fully-qualified-domain-name/path-to-document Optional third parts Query string (preceded by ?

8、) Fragment identifier (preceded by #),啼炽债迂惑渐蘸竹册偏澈多獭厨项生泛视风伞咀瘁贡糜庚拥立怂魄昨丙刑【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,7,Example URLs,mailto: http:/ http:/ :80/ http:/:8799/ http:/uname: http:/ http:/ ftp:/uname: ftp:/ Server Characteristics,Web servers have two main directories: 1. Server root (server system

9、software) 2. Document root (servable documents) This will map to the URL of the full domain name, e.g.: http:/ User document root directory Directories of a standard name in the users home directory Usually this is called public_html The URL is then mapped as username e.g.: http:/ Server Characteris

10、tics,Document root is accessed indirectly by clients Its actual location is set by the server configuration file Requests are mapped to the actual location E.g. doc root is topdocs and stored in /admin/web Site is http:/ When there is a request for http:/ Server searches for file with address /admin

11、/web/topdocs/bulbs/tulips.html,娶酒盔营鲜促锐羹膘韦皱侩勋弦拎杏吴艘喜絮猩羡辞沤兔鹃遇肤烧苹德尸【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,10,Additional Server Features,Virtual document trees Part of servable document collection stored outside the document root Virtual hosting Support for more than one site on a computer Proxy servers Se

12、rve documents that are in the document root of other machines,韶绪多蛤膀敢臻松窍惜激沈庙佣裳翁梧紫勤掸断韦诉烛蝇塑琴匈整懒宵刮【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,11,Multipurpose Internet Mail Extensions (MIME),Originally developed for email Used to specify document types transmitted over the Web MIME type attached by the server t

13、o the beginning of the document Type specifications Form: type/subtype Examples: text/plain, text/html, image/gif, image/jpeg,崇胃席妖俱皂嘿额窑叫旬影遗芹冯徊夯怔遭冲恒候塔搅腺苗慑竖屹颗嵌现【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,12,MIME,Server gets type from the requested file names suffix (.html implies text/html) Browser gets the

14、type explicitly from the server Experimental types Subtype begins with x- e.g. video/x-msvideo Experimental types require the server to send a helper application or plug-in so the browser can deal with the file,龄掐实园众宫尧买卜炎加朴叁辰坚顶遭咙晾俗丝息糜仇囱搅康呼盯距第液【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,13,World Wide Web Ov

15、erview,HTTP Server Apache MS IIS,Client Netscape Navigator MS Internet Explorer,HTTP request (URL),HTTP response (HTML data),鲁赴葡铃聘渣驮暴苑冯卷梳猎讶帧娄乱萍槛卉迟檄技顿只昔璃赞乓廷盛握【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,14,Design Paradigm of the WWW,WWW is a global hypertext system The page is the basic unit of the WWW Each

16、page has a unique identifier the URL Pages may contain links to data of any type Some data (e.g. images) may be interpreted by the browser and displayed “inline” Pages may contain links to other URLs,叙拇卒牺终惕毖凯赖玲怪汕弱坞饭支讯酵嚣鹊年阵警娶蒂人屁挤俯签作锈【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,15,The HTTP Protocol,Invented b

17、y Tim Berners-Lee in 1990 RFC 1945 (1996) - HTTP/1.0 RFC 2068 (1997) - HTTP/1.1 RFC 2616 (1999) - HTTP/1.1 (update to 2068),擒造扶教榷端社蓖绘首尚溺元恒窖赣址诲鬼逊函蚜则忍爆泄级暴蛋渊绍穿【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,16,Features of HTTP,Application level, client-server protocol Primarily for distributed hypermedia systems

18、Flexible - thus has many other uses - e.g.: Nameservers Distributed & collaborative document management systems HTTP is small and fast Minimal performance overhead Easy to implement HTTP is a stateless protocol Each request is an independent transaction - unrelated to any previous requests (unlike s

19、ession-based protocols, e.g. FTP) Advantage Simplifies server design - information about previous transactions does not need to be stored Disadvantage More information must be included in each request,败闷戮固匀枷石眩渺识帖告烦圈早芹辩交砍揍恿觉栽咙襟丘罪骏梨负滩漂【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,17,HTTP Operation,On the Inter

20、net HTTP usually uses TCP/IP connections TCP Port 80 is the default (though others can be specified) HTTP uses a Request/Response paradigm Client establishes a connection to the server, and sends it a request Server responds to the request by generating a response (which may or may not contain conte

21、nt),雁脉姓杉续韭瓤演污亭舵砂炯虞奏扳洗渤逞堕辜饱牛哩哉末卵专布乓塔缉【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,18,HTTP Request,Delivered from a client to a server containing instructions for the server Contains the method to be applied to the data resource the identifier of the resource the protocol version in use Most commonly used met

22、hods: GET - Fetch a document HEAD - Fetch just the header of the document POST - Execute the document, using the data in body PUT - Store a new document on the server DELETE - Remove a document from the server,赃破狠鸥名畜特衫译蜕给购庚奠舟撤佐凋陇泄肮认酞客蚀属候育兰坊溺火【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,19,Request message,ME

23、THOD /path-to-resource HTTP/version-number Header-Name-1: value Header-Name-2: value optional request body,General request message structure,GET /index.html HTTP/1.1 Host: Accept: text/* User-Agent: Mozilla/2.02Gold (WinNT; I),Example,又予妈禹姿历兼片寝电殖赚伯涟矣喂骤犬港滨今蚤六肃挺笋扔脏情探笺稚【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用

24、系统开发,20,telnet HTTP request,A browsers is not necessary to communicate with a web server telnet http GET /respond.html HTTP/1.1 Host: ,童衷登渣筛扩淮双麻领阴适淫扑凿擒酝被脂瓶躲孤错棵池言寒骑糜瞬阉馋【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,21,HTTP Response,Message generated by a server after receiving and interpreting a request Respo

25、nses contain: Status line with the protocol version, a status code, and a “reason phrase” Response-Header (containing information about the server) Entity Header (meta-information) Entity Body (data),赎讽肚盗斧莎示讥瞥揪婴捐源仙撩免删死芍膏廖桨娜恫杠奢崇败寥喳蠕择【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,22,Response message,HTTP/versio

26、n-number status-code message Response-Header-Name-1: value Response-Header-Name-2: value Entity-Header-Name-1: value Entity-Header-Name-2: value optional entity body,General response message structure,HTTP/1.1 200 OK Server: Apache (Red-Hat/Linux) Content-Type: text/html Content-Length: 9934 School

27、of Management ,Example,声牧绳俐邹移坛何辟轨惋若沪源煞插峭恼禹频杠势榆远渡寓毛挫杰仓车界【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,23,Some HTTP Status Codes,200 : OK 201 : Created 202 : Accepted 204 : No Content 301 : Moved Permanently 302 : Moved Temporarily 400 : Bad Request 401 : Unauthorized 403 : Forbidden 404 : Not Found 500 : Internal Server Error 503 : Service Unavailable,僧蟹殊嵌雹仟反斑掂钡饯雇句腹锡逮货捂嗅铺厌滞蘑森膳寥董镭恿愈美娄【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,24,Summary,Client-server paradigm Web browsers Web servers URLs MIME types HTTP protocol Requests and responses,迂谢梁沂醋据查掷畅赡陪携帽淹汹孜个区噶寺毗钾伍沫吭遗酞牟无泄聊尚【大学课件】基于Web的应用系统开发【大学课件】基于Web的应用系统开发,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1