大学课件基于Web的应用系统开发_第1页
大学课件基于Web的应用系统开发_第2页
大学课件基于Web的应用系统开发_第3页
大学课件基于Web的应用系统开发_第4页
大学课件基于Web的应用系统开发_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、基于web的应用系统开发4. web browsers, servers and httphttp:/ paradigm lweb browserslweb serverslurl lmimelhttp 3the client server paradigmla widely used form of communicationlserver application waits passively for contact from clientsla server provides a specific servicelclient application actively initiates

2、 contact with the serverlinformation can flow in both directionsltypical situation is many clients interacting with each server4web browserslbrowsers are clients always initiate, servers react lallow user to browse resources available on server either existing or dynamically built documentsl mosaic

3、- 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 by late 1993lcurrent common browsers internet explorer, netscape, opera, mozilla firefox, safari, google chrome (as of 9/3/08)5web servers

4、lprovide responses to browser requestslall communications between browsers and servers use hypertext transfer protocol (http)lweb servers run as background processes in the operating system monitor a communications port on the host, accepting http messages when they appearlcommon servers apache, int

5、ernet information server (is)6uniform resource locators (urls)lstandard way of specifying entities on networkslfirst part - protocol terminated by colon ( : ) common protocols are http, ftp, mailto, telnet, i.e.: http: ftp: mailto: telnet:lsecond part - varies according to protocol mailto - e-mail a

6、ddress e.g.: mailto: 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-documentloptional third parts query st

7、ring (preceded by ?) fragment identifier (preceded by #)7example urlslmailto:lhttp:/ :80/lhttp:/:8799/lhttp:/uname: server characteristicslweb servers have two main directories: 1. server root (server system software) 2. document root (servable documents) this will map to the url of the full domain

8、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 characteristicsldocument root is accessed indirectly by clients its actual location is set by the server

9、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/web/topdocs/bulbs/tulips.html 10additional server features lvirtual document trees part of se

10、rvable document collection stored outside the document root lvirtual hosting support for more than one site on a computerlproxy servers serve documents that are in the document root of other machines11multipurpose internet mail extensions (mime)loriginally developed for emaillused to specify documen

11、t types transmitted over the web mime type attached by the server to the beginning of the documentl type specifications form: type/subtype examples: text/plain, text/html, image/gif, image/jpeg12mime lserver gets type from the requested file names suffix (.html implies text/html)lbrowser gets the ty

12、pe explicitly from the serverlexperimental 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 file13world wide web overview http server apache ms iisclientnetscape navigator ms internet expl

13、orerhttp request (url)http response (html data)14design paradigm of the wwwlwww is a global hypertext systemlthe page is the basic unit of the wwwleach page has a unique identifier the urllpages may contain links to data of any typelsome data (e.g. images) may be interpreted by the browser and displ

14、ayed “inline”lpages may contain links to other urls15the http protocol linvented by tim berners-lee in 1990lrfc 1945 (1996) - http/1.0lrfc 2068 (1997) - http/1.1lrfc 2616 (1999) - http/1.1 (update to 2068)16features of httplapplication level, client-server protocol primarily for distributed hypermed

15、ia systems flexible - thus has many other uses - e.g.: nameservers distributed & collaborative document management systemslhttp is small and fast minimal performance overhead easy to implementlhttp is a stateless protocol each request is an independent transaction - unrelated to any previous request

16、s (unlike session-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 request17http operationlon the internet http usually uses tcp/ip connectionsltcp port 80 is the

17、default (though others can be specified)lhttp 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 content)18http requestldelivered from a client to a server contai

18、ning instructions for the serverlcontains the method to be applied to the data resource the identifier of the resource the protocol version in uselmost commonly used methods: get - fetch a document head - fetch just the header of the document post - execute the document, using the data in body put -

19、 store a new document on the server delete - remove a document from the server19request messagemethod /path-to-resource http/version-numberheader-name-1: valueheader-name-2: valueoptional request body general request message structure get /index.html http/1.1 host: accept: text/*user-agent: mozilla/

20、2.02gold (winnt; i)example 20telnet http requestla browsers is not necessary to communicate with a web server telnet http get /respond.html http/1.1 host: 21http response lmessage generated by a server after receiving and interpreting a requestlresponses 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)22response messagehttp

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论