天天看点

Chapter 30 Web Technology and DBMSsChapter 30 Web and Technology and DBMSs 

Chapter 30 Web and Technology and DBMSs 

chapter objectives

In this chapter you will learn:

  • The basics of the Internet, web, HTTP, URLs and Web services.
  • The advantages and disadvantages of the web as a database platform.  Approaches for integrating databases into the web environment:  
    • scripting languages ( JavaScrip, VBscript, PHP, and Perl); 
    • common Gateway Interface (CGI);
    • HTTP cookies; 
    • extending the web server; 
    • Java, JEE, JDBC, SQLJ,CMP,JDO,JPA,Servlets, and JavaServer Pages(JSP);
    • Microsoft Web Platform: .Net, Active Server Pages(ASP), and ActiveX Data Objects (ADO);
    • Oracle Internet Platform

Just over two decade after its conception in 1989, the world wide web (the Web for short) is the most popular and powerful networked information system to date .

@ 1. decade/'dekeid/ n. a period of ten years. 十年期间;十年;@ 

Its growth in the past few years has been near exponential and it has started an information revolution that will continue through the next decade. 

@2. exponention /,ekspənenʃə/ adj. technical using a sign that shows how many times a number is to be multipled by itself. (术语)指数的;含有指数的; @

Now the combination of the web and database brings many new opportunities for creating advanced database application.

      The web is compelling platform for the delivery and dis-semination of data-centric, interactive applications. 

@3. compelling /,kəm'peliŋ/ adj. extremely interesing or exciting 极为有趣的,令人激动的@

@4. dis-semination /di,semiə'neiʃən/ n. formal to spread information, ideas etc to as many people as possible, especiallly in order to influence them (正式)(尤指为了影响他人而)散步,广泛传播(消息,观点等)@

@5. delivery /di'livəri/ n. the act or process of bringing goods, letters etc. to the person or place they have been sent to 送货;送信;交付@

The web's ubiquity provides global application availability to both users and organizations. 

@6. ubiquity /ju:'bikwiətəs/ adj. formal or humorous seeming to be everywhere (正式或幽默)普遍存在的;无处不在的@

Because the architecture of the web has been designed to be a platform-independent, it has the potential to significantly lower deployment and training costs

@7. potential /pə'tenʃə/n. the possibility that something will develop in a certain way, or have a particular effect. 可能性;潜在性@

@8. deploy /di'plɔ:/ v. to organize people or things, especially soldiers, military equipment etc., so that they are in the right place and ready to be used 部署, 调动(尤指士兵、军事装备)@

Organizations are now rapidly building new database applications or reegineering existing ones to take advantages of web as a strategic platform for implementing innovative business solutions, in effect becoming Web-centric organizations .

@9.innovative /'inə,veitiv/ adj. an innovative process, method, plan etc is new, different, and better than those that existed before(程序,方法,计划)新颖的,有创新精神的;using clever new ideas and method 运用新观念和新方法的@

@10. strategic /strə'tidʒik/ adjd. done as part of a plan, especially in a military, business, or politial situation 战略上的;策略上的@

  Transcending its root in government agencies and educational institutious, the Internet (of which the web forms a part) has become the most siginificant new medium for communication between and among organization, educational and government institutions and individuals. 

@11. trancend /træn'send/ v. formal to go above or beyond the limits of something (正式)超越;超过;超出; @

@12. root /ru:t / n. = cause of a problem 问题的起因= the main cause of a problem (问题的)根源, 起因@

@13. medium /'mi:diəm/ adj. a way of communicating information and news to people 传播媒介(如报纸、电视等)@

Growth of the Internet and corporate intranets/extranets will continue at a rapid pace through the next decade, leading a global inter-connectedness on a scale unprecedented in the history of computing. 

@14. pace /peis/ n. keep pace (with) to move or change as fast as someone  or something else (与...)并驾齐驱;齐头并进;跟上... @

@15. unprecedented /ʌnpresiədentiəd/ adj. never having happened before, or neve happen so much. 空前的;前所未有的;@ 

  Many Web sites today are file-based; each Web document is stored in a separate file

  

For small Web sites, this approach is not too much of a problem.  

However, for a large site, this method can lead to significant management problem.

For example, maintaining current copies of hundreds or hundreds of different documents in separent files is difficult enough, but maintaining links between these files ie even more formidable, particularly when the documents are created and maintained by different authors.

@16. formidable /'fɔ:miədəbəl/ adj. a formidable person etc. is one that  you feel respect for because they are very powerful, or impressive, 令人敬畏的,令人惊叹的;杰出的;different to deal with and needing a lot of effort or skill 难对付的;@

  A second problem stem from the fact that many web sites now contain more information of a dynamic nature,such as product and pricing information. 

@17. stem / 'steim/  vt. stem from (T not in progressive  不用于进行时态)  to develop as a result of something else 源于...; 来自...; @

Maintaining such information in both a database and in separate HTML files (see section 30.2.2) can be an enormous task, and difficult to keep synchronized. 

@18.synchronize / ,siŋkrənaiz/  v. to arrange for two or more actions to happen at exactly the same time. 使同步;使同时发生; @

@19. enormous /i'nɔməs/ adj. 巨大的;庞大的; @

For these and other reasons, the approach of allowing databases to be accessed directly from the Web is increasingly being adopted for the management of dynamic web content. 

The storage of Web information in a database can replace or complement file storage. 

@replace vt. 取代;complement vt. 补充;补足;@

The aim of this chapter is to examine some of the current technologies for Web-DBMS integration to give a flavor of what is available. 

@20.flavor /'fleivə/ n. a quality or feature that makes something have a particular style or character 特色,特点@

A full discussion of these technologies is beyond the scope of this book,  but the interested reader is reeferred to the additional reading material cited for this chapter at the end of the book .

@21. cite /sait/ v. to give the exact words of something that has been written in order to support an opinionor prove an idea. 引用;引述;  @

Structure  of this Chapter    

In section 30.1 and 30.2 we provide a brief introduction to Internet and Web technology and examine the appropriateness of the Web as a database application platform. 

In Section 30.3 to 30.9 we examine some of the different approaches to integrating databases into the Web environment. 

The examples in this chapter are once again drawn from the DreamHome case study documented in section 11.4 and Appendix A. 

To limit the exent of this chapter, we have placed lengthy examples in Appendix L . 

In some sections we refer to the extensible Markup Language (XML) and its related technologies, but in the main we defer discussion of these until the next chapter.

@21. defer /'difæ/  v. to delay something until a later date. 延期, 推迟;@

However, the reader should note the important role that XML now has in the web environment. 

30.1  Introduction to the Internet and the Web 

Internet   A worldwide collection of inter-connected computer networks. 

The Internet is made up of many separate but inter-connected networks belonging to commerical, educational, and government organizations and Internet Service Provides(ISPs). 

The services offered on the Internet include electronic mail (email), conferencing and collaboration services, as well as the ability to access remote computers and send and receive files. 

@22.conference /kɔnfərəns/ n. a large formal meeting where a lot of people discuss important matters such as business or politics, especially for serveral day. 会议(指很多人参加讨论重要事宜的大型会议,尤指历时数天的会议)@

@23.collaboration /kə,læbə'reiʃən/ n. the act of working together with another person or group to achieve something, especially in Science or art (尤指在科学或艺术方面的)合作、协作;@

It began in the late 1960s and early 1970s as an experimental US Department of Defense project called ARPANET (Advanced Research Projects Agency Network) investigating how to build networks that could withstand partical outages (like nuclear bomb attacks) and still survive.

@24. experimental /[ɪkˌsperɪˈmentl/ n. 实验性的@

@25. defence / di'fens/ n. all the armies and weapons that are available to defense a place 防御力量;@

@26. investigate /in'vestiəgeit/ v. to try to find out the truth about something such as a crime, accident or scientific problem 调查;审查; @

@27. outage /'autidʒ/ n. a period when a service such as the electricty supply is not provided (电力等的)断供期; @

@28. withstand /wið'stænd/ v. to be strong enough to remain unharmed by something such as great heat or cold, great pressure etc. 耐得住(酷热、严寒、高压等)承受住@

@29. partial  /'pa:ʃəl/ adj. not complete 部分的;不完全的;@

    In 1982, TCP/IP  (Transmission Control Protocol/ Internet Protocol ) was adopted as the standard communications protocols for ARPANET. 

Tcp is responsible for ensuring correct delivery of messages that move from one computer to another. 

IP manages the sending and reeiving of packets of data between machines, based on a four-byte destination address (the IP number), which is assigned to an organization by the Internet authorities.

The term TCP/IP  sometimes refers to the entire Internet suite of protocols that are commonly run on TCP/IP, such as FTP (File Transfer Protocol), SMTP( Simple Mail Transfer Protocol), Telnet(Tele-communication Network), DNS(Domain Name Service), POP (Post office Protocol), and so on.

    In the process of developing this technology, the military  forged strong links with large corporations and universities. 

  @30. forge/fɔ:dʒ/ vt. forge  a relationship/ alliance/ links etc. to develop a strong relationship with other group or other copubntries (与它的国家或团体)建立关系、结盟、建立联系等@

  

As s result, responsibility  for the continuing research shifted to the National Science  Foundation (NSF) and, in 1986, NSFNET (National Science Foundation NETwork) was created, forming the new backbone of the network.

@backbone /'bækbəun/ n. the backbone of = the most important part of an organization, set of ideas etc. 骨干,支柱,主力, 中坚;@

under the aegis of the NSF, the network become known as the Internet.

@32.aegis/'i:dʒiəs/ n.  under the aegis of formal with the protection or suppport of a person or organization. (正式)在...支持下(保护下);@

However, NSFNET itself ceased to form the Internet backbone in 1995, and a fully commerical system of backbones has been created in its place. 

@cease/si:s/ vt. put an end to a state or an activity停止;@

The current Internet has been likened to an electronic city with virtual libraries, storefronts, bussiness offices, art galleries, and so on. 

@33. liken /'laikən/ v. liken sb./ sth. to sb./sth. [T usually passive 一般用被动态] formal to describe something or someone as being similar to an person or thing (正式)将某人或某物比作(另一人或物)@

@34 . gallery /' gæləri/ n. a large buliding where people can see famous pieces of art. 美术馆;@

  Another term that is popular, particularly with the mediu, is the "Information Superhighway".

This is a metaphor for the future worldwide network that will provide connectivity, access to information, and online services for users around the world.

@35. metaphor /'metəfə/ n. something in book, painting, film etc. that is intended to represent a more general idea or quality, symbol. ( 书、画、电影等中的)象征(+ for) @

 The term was first used in 1993 by then-vice President AL Gore in a speech outlining plans to build a high-speed national data communications network, of which the Internet is a prototype. 

@37. ptototype /'prəutətaip/ n. the first form that a new design of a car, machine etc has (新型汽车、机器等的)原型,雏形; @

In his book The Road Ahead, Bill Gates (chairman and co-founder of Microsoft) likens the United States, where the Internet represent the starting in the construction of a new order of networked communication (Gates 1995).

  The Internet began with funding from the NSF as a mean to allow American univerisities to share the resources of five national supercomputing centers.

@37. funding /'fʌndiŋ/  n. an amount of money used for a specific purpose. 专款;拨款;@

Its numbers of users quickly grew as access became cheap enough for domestric users to have their own links on PCs. 

@38. domestic /də'mestil/ adj. about family and home= concerning family relationships and life in home涉及家庭关系和生活的;家事的 @

By the early 1990s, the wealth of information made freely available on this network had increased so much that a host of indexing and  search services sprang up to answer user demand such as Archie, Gopher, Veronica, and WAIS (Wide Area Information Service), which provided services through a menu-based interactive.

@39. spring up = to suddenly appear or share to exist 突然出现,开始存在;@

In contrast, the web uses hypertext to allow browsing, and a number of Web-based search engines were created, such as Google, Yahoo!, and MSN. 

  From initially connecting a handful of nods with APPANET, the Internet was estimated to have over 100 million users in Junuary 1997. 

@ a handful of =  几个,不多;@

@estimate/'əstimət/ vt. 估计;估算;@

One year later, the estimate had risen to over 270 million users in over 100 countries, and by the end of 2000 the revised estimate was over 418 million users with z further rise to 945 million users by the end of 2004. 

@40. revise estimate = a calculation that has been changed to make it more accurate. 修正的估计@

One projection for expected growth predicts 2billion users by 2010 (at end of 2008, there were approximately 1.5 billion online users)

In addition, there are currently about 3.5 billion documents in the Internet, growth at 7.5 million a day. 

If we include intranets and extranets ( explained next), the number of documents rises to an incredible 550 billion.

@incredibly/in'krediəbli/ adv. in a way that is hard to believe. 难以置信的。@

30.1.1  Intranets  and Extranets

intranet      A web site or group of sites belonging to an organization, accessible only by the members of the organization. 

  Internet standards for exchanging email and publishing Web pages are becoming  increasingly popular for business use within closed networks called intranets.

Typically, an intranet is connected to the wider public Internet through a firewall ( see section 20.5.2), with restriction imposed on the types of information that can pass into and out of the intranet.

@42. impose /'impəuz/ vt. to force someone to have the same ideas or beliefs as you. (将想法,信仰)强加于某人@

Secure intranets are now the fastest-growing segment of the Internet, because they are much less expensive to build and manage than private networks based on proprietary protocols. 

@secure /si:'kjuə/ adj. permance / certain 永久的/确定的;a situation that is secure is one that you can depend on because it is not likely to change 稳定的;可靠的;稳定的;@

@propriety /prə'praiət/ n. formal (正式) !(singlar u) correctness of social moral behaviour especially between men and women or between people of different social ranks, age etc. (尤指男女之间或不同社会等级或年龄之间的)礼貌;规矩@

Extranet      An intranet that is partially accessible to authorized outsiders.

  Whereas an intranet resides behind a firewall and is accessible only to people who are members of the same organization, an extranet provides various levels of accessibility to outsiders.

@47. partially /'pa:ʃəli/ adv. formal (正式) not completely partly 不完全的;部分的;@

@48. whereas /'wear'æs/ adj. used to say that although something is true of one thing, it is not true of another. 但是,却(用于说某事不适用于所有情况)@

Typically, an extranet can be accessed only if the outsider has a vaild user-name and password, and this identity determines which parts of the externet can be viewed.

Extranets have become a very popular means for business partners to exchange information. 

  other approaches that provide this facility have been used for a number of years. 

For example, Electronic Data Inter-change (EDC) allows organizations to link systems such as inventory and puchase-order. 

@49. inventory /'invətri/ n. a list of all the things in a place (一个地方所有东西的)详细目录;清单;@

@50. purchase /'pætʃiəs/ n. formal the act of buying something (正式)购买;采购;@

These links foster applications such as just-in-time (JIT) inventory and manufacturing, in which products are manufactured and shipped to a retailer on an "as-needed" basis. 

@51.foster/'fɔstə/ vt. to help a skill, feeling, idea etc develop over a period time. 促进,培养;助长; @

@52. retail /ri'teil/ v. technical to sell goods in a shop (术语)零售;零卖; @

However, EDI requires an expensive infrastructrue. 

@infrastructure/ˈɪnfrəstrʌktʃə(r)/ n. 基础设施 @

Some organizations use costly leased lines; most outsource the infrastructure to value-added netwoks(VANs), which are still far more expensive than using the Internet. 

EDI also necessitates expensive integration among applications.

@54. necessitate /niə'sesiəteit/ vt. formal to make it necessary for you to do something. (正式)使成为必需;需要;@

Consequently, EDI  has been slow to spread outside its key markets, which include transportation, manufacturing, and retail. 

 因此,EDI 已经缓慢向外蔓延自已的市场,它包括:运输业,制造业,和零售业。

In constrast, implementing  an extranet is relatively simple. 

It used standard Internet componenet: a Web server, a brower- or applet-based application, and the Internet itself as a communications infructure. 

In addtion, the extranet allows  organizations to provides information about themselves as a product  for their  customs. 

For example, Federal Express provides an extranet that allows customs to track their own packages.

@55. federal /'fedərəl/ adj. (联帮)制@

Organizations can also save money using extranets: moving parpaer-based  information to Web, where user access the data they need when they need it, and can potentially save organizations significant amounts of money and resources that would otherwise have been spent on priting, assembing packets of information, and mailing. 

In this chapter , generally we use thw more inclusive term "Internet" to incorprate both intranets and extranets. 

@56. inclusive / in'klu: siv /n. an inclusive price or cost include everything. (价钱、费用)包括一切的;、@

30.1. 2 e-commerce and e-Business 

There is consideral discussion currently about the opportunities the Internet provides for electronic commerce (e-commerce) and electronic bsiness (e-business).  

As with many emerging developments of this nature, there is some debate over the actual definitions of these two terms.

@57. mebate/di'beit/ n. discussion or argument on a subject that people have different  opinions about. 讨论; @

Cisco systems, now one of the largest organizations in the world, defined five incremental stages to the Internet evolution of a business, which include definitions of these terms. 

@58. increment / 'iŋkriəmənt/ n. an amount that is regularly added to the amount that someone is paid each year. (每年薪金的定期)增加;增额;@

Stage 1 : Email   As well as communicating and exchanging files across an internal network, businesses at this stage are beginning to communicate with supplier and customers by using the Internet as an external communication medium. 

This delivers an immediate boost to the business's efficiency and simplifies global communication. 

@59. deliver /di'livə/ vt. 给予: @

@60. boost /bu:st/ n. something that helps someone be more successful and confident, or that helps something increase or improve. 激励;鼓励;增加,改进;@

stage 2. web site 

Business at this stage have developed a web site, which acts as a shop window to the world for their business products. 

  The Web site also allows customs to communicate with the business at any time, from any where, which gives even the smallest business a global presence. 

@61. presene // n. 出席;到场;存在;@

stage 3 :  e-commerce 

e-commerce  customers can place and pay for orders via the business's web site.

@62. place an order = make an order 订货;下订单;@

Business at this stage are not using their Web site as a dynamic brochure but also allowing  customers to make procurements from the Web site, and even be providing service and support online as well. 

@63. brochure /'brəuʃə/n. a thin book giving information or advertising something. 小册子@

@64. procure /'prəkjuə/ v. to obtain something, especially something that is difficult to get. 获得;取得(尤指难以得到的事物)。  @

This would involve some form of secure transaction using one of the technologies discussed in Section 20.5.7. 

This allows the business to trade 24 hours a day, every day of the year, thereby increasing sales opportunities, reducing the cost of sale and service, and achieving improved customer stasifaction.

stage 4 e-Business 

e-Business  complete integration of Internet technology into the economic infrastruction of the business.

Business at this stage have  embraced Internet technology through many parts of their business. 

@embrace /im'breis/ v. formal  to include something as part of a subject, discusion etc. (正式)包括;涉及; @

Internal and extenal processes are managed through intranets and extranets: sales, service, and promotion are all based around the web. 

Among the potential advantages are that the business  achieves faster communication, streamlined and more efficient processes, and improved producitivity.

@66. streamlined /'stri:mlaid/ adj. to form something into a smooth shape so that it moves easily through the air or water. 使...成为流线型; @

Stage 5. Ecosystem 

In this stage, the entrie business process is automated via the Internet.

Customers, suppliers, key alliance partners, and the corporate infrastructure are integrated into a seamless systems.

@67. seamless /'si:mləs/ adj. something seamless is done or happens so sommthly that  you can not tell where one thing stops and anther begins 平滑的;浑然一体的;@

@68. alliance /ə'laiəns/ n. the arrangment in which two or more countries, groups etc agree to work together in order to try to change or achieve something.(国家、团体之间的)联盟、同盟 ;@

It is argued that this provides lower costs, higher productivity, and significant competive advantage.

According to the Forrester Research GROUP and eMarketer, U.S. online sales reached US$175 billion in 2007 and are projected to grow to US $335 billion by 2012, while in Europe online sales have grown to   106  billion (US  $ 133Billion) and will reach 323 billion (US $ 407  billion ) by 2011.

Forrester  also suggests that the business-to-business (B2B) market segment grew from  US$ 2.8 trillion in 2004 to US $ 4.1 trillion in 2005 and US$ 6.8 trillion in 2007.

By 2012 it has been predicted by IDC that there will be more than 1billion online buyers worldwide, making business-to-consumer (B2C) transaction worth US$1.2 trillion and B2B transaction worth US$ 12.4 trillion.

30.2 The Web 

The Web   A Hyper-media-based  system that provides a means of browsing information on the Internet in non-sequential way using hyperlinks.

@70. hype /haip/ n. attempts to make the public interested in a product, film etc. by saying how good it is on television, radio etc. (传媒的)大肆宣传,炒作;@

The world wide web  (the web for short) provides  a simple "point and click" means of exploring the immense volume of pages of information residing on the Internet (Berners-Lee, 1992; Berners-Lee et al., 1994). 

@immense /imens/ adj. extremely large  巨大的;@

Information on the web is presented on Web pages, which appear as a collection of text, graphics, pictures, sound, and video. 

In addition,  a Web page can contain hyperlinks to other Web pages, which allow users to navigate in a non-sequential way through information. 

Much of the web's success is due to the simplicity with which it allows users to provide, use, and refer to information distributed geographically around the world. 

Furthermore, it provides users with the ability to browse  multi-media  documents independently of the computer hardware being used.

It is also compatible with other existing data communication protocols, such as Gopher, FTP (File Transfer Protocol), NNTP (Network News Transfer Protocol), and Telnet (for remote login session).

The Web consists of a network of computers that can act in two roles: as servers, providing information;  and as clients, usually referred to as browsers, requesting information. 

Examples of Web servers are Apache HTTP server, Microsoft Internet Information Serve (IIS), and Google web server (GWS) , and examples of web browsers are Microsoft Internet Explorer, Firefox, Opera, and Safari. 

Much of the information on the web is stored in documents uising a language called HTML (HyperText Markeup Language), and browsers must understand and interpret HTML to display  these documents. 

The protocol that govern the exchange of information between the web server and the brower is called HTTP (HyperText Transfer Protocol).

Documents and locations within documents are identified by an address, defined as  a uniform Resource Locator (URL).

Figure 30.1 illustrates the basic components of the web enviroment, we now discuss HTTP, HTML, and URLs in some more detail.

30.2.1 HyperText Transfer Protocol 

HTTP :  the protocol used to transfer web pages through the Internet. 

The HyperText Transfer Protocol (HTTP) defines how clients and servers communicate.

HTTP is a generic object-oriented, stateless protocol to transmit information between servers and clients (Berners-Lee, 1992).

@77. stateless /'steitləs/ adj. not officially being a citizen of any country 无国籍的@

@generic /dʒiə'nerik / adj. generic name/term/label etc. a word that describe a whole class of things. 属名、通称等(用于描述一类事物的词)@

HTTP /0.9 was used during the early development of the web. 

HTTP/ 1.0 which was released in 1995 as information RFC 1945, reflected common usage of the protocol (Berners--Lee et al., 1996)

The  most recent release, HTTP/1.1, provides more functionality and support for allowing multiple transcations to occur between client and  server over the same time. 

HTTP is based on a request-respone paradigm. 

@76.paradigm/'pærədaim/ n. formal a very clear or typical example of something (正式)示例;范例;样式;technical a model or example pof something works or is produced (术语)(展示工作或制作方式的)模型@

/HTTP,是基于一个请求应答的模式。/

An HTTP transaction consists of the following stages: 

! connection: the client establishes a connection with the web server.

!Request: the client  sends a request message to the web server.

!response: the web server sends a response (for example, an HTML document) to the client.

!close: The connection is closed by the web server. 

HTTP is currently a stateless protocol-- the server retains no information between request.

@77. stateless /'steitləs/ adj. not officially being a citizen of any country. 无国籍的; @

@78. retain /ri'tein/ v. to keep something or continue to have something. 保留;保有;@

Thus, a web server has no memory of previous requests.

This means that the information a user enters on one page (through a form, for example) is not automatically available on the next page requested,

unless the web server takes steps to make that happen, in which case the server must somehow identify which requests, out of the thousands of requests it receives, come from the same time. 

For most applications, this stateless property of HTTP is benefit that permits clients and servers to be written with a logic and run "lean" with no extra memory or disk space taken up with information from old request.

Unfortunately, the stateless property of HTTP  makes it difficult to support the concept of a session that is essential to basic DBMS transactions. 

@session /'seʃən/ n. a meeting or period of time used for a particular purpose, especially by a group of people. 会期;(某团体从事某项活动的)一段时间;@

Various schemes have proposed to compensate for the stateless nature of HTTP, such as returing web pages with hidden fields containing transaction identifiers, and using web page forms where all the information is entered locally and then submitted as a single transaction.

@80. compensate /'kɔmpənseit/ vt. to replace or balance something good that has been lost or is lackin, by providing or doing something equally good. 弥补;抵消;@

All these schemes are limited in the types of application that they support and require special extensions to the web servers, as we discuss later in this chapter. 

Multi-purpose Internet Mail Extensions

The Multipose Internet Mail Extensions (MIME) specifications define a standard for encoding binary data into ASCII, as well as a standard for indicating the type of the data contained inside a message. 

Although originally used by emial client software, the web also makes use of the MIME standard to determine how to handle multiple media types. 

MIME  types are identified using a type/sub-type format, where  type classifies the general type of data being sent, and subtype defines  the specific type of format used.

For example, a GIF image would be formatted as image/gif. 

Some other useful types (with default file extensions) are listed in Table 30.1.

                            TABLE 30.1  Some useful MIME type

 MIME TYPE   MIME SUBTYPE  DESCRIPTION
 TEXT  html  HTML files (*.html, *htm)
 plain (朴素的;简单的)  Regular ASCII (*.txt)
 image   jpeg   Joint Photographic Experts Group files (*.jpg)
 gif  Graphics Interchange Format  files (*.gif)
 x-bitmap   Microsoft bitmap files (*.bmp)
 video   x-msvideo  Microsoft Audio Video  Interleave files (*.avi)
 quicktime   Apple QuickTime Movie files (*.mov)
 mpeg   Moving Picture Experts Group files (*.mpeg)
 application   postscript   postscript files (*.ps)
 pdf  Adobe Acrobat files(*.pdf)
 java   Java class file (*.class )

HTTP request 

An HTTP request consists of a header indicating the type of request, the name of a resource,  and the HTTP version, followed by an optional body.

The header is separated from the body by a blank line.

The main HTTP request types are:

1. GET   This is one of the most common types of request, which retrieves (gets) the resource the user has requested.

2. POST Another common type of request, which transfers (posts) data to the specified resource.

Usually the data sent comes from an HTML from that the users had filled in, and the server may use this data  to search  the Internet or query a database.

3. HEAD Similar to Get but forces the servers to return only an HTTP header instead of respone data.

4. PUT (HTTP /1.1) Uploads th resource from the server.

5. DELETE (HTTP/1.1) .Deletes the source from the server.

6. OPTIONS (HTTP/1.1) Requests the server's configuration options.

HTTP response

An HTTP response has a header containing the HTTP  version ,  the status of the response, and header information to control the reponse behavior, as well as any requested data in a response body.

Again, the header is separated from the body by a blank line.

30.2.2  HyperText  Markup language 

HTML   The  document fomatting language used to design most Web pages. 

The HyperText Markup Language (HTML) is a system for marking up, or tagging, a document so that it can be published on the Web.

@81. tag /tæg/ n. a small piece of paper, plastic etc. fixed to something to show what it is, who owns it, what it costs, etc. 标签;标牌 @

HTML defines what is generally transmitted between nodes in the network.

It is a simple, yet powerful, platform-independent document language (Berner-Lee and Connolly, 1993).

HTML was originally developed by Tim Berner-Lee while  he was at CERN but was standardized in Novermber 1995 as the IETF(Internet Engineering Task Force) RFC1866, commonly referred to as HTML version 2.

The language has evolved and the World Wild Web Consortium(W3C) currently recommendeds use of HTML 4.0.1, which has mechanisms for frames, stylesheets, scripting, and embedded objects (W3C, 1999a).

@82. evolve /i'vɔlv/ v. to develp or make something develop by gradually changing (使)逐步发展。 @

?W3C is an international joint effort with the goal of overseeing the development of the web.? 

In early 2000, W3C  producted XHTML 1.0 (exetensible HyperText Markup Language) as a reformulation of HTML 4 in XML (extensible Markup Language) (W3C, 2000a).

We disccuss XML in the next chapter. 

HTML has been developed with the intention that various types of devices should be able to use information on the Web : PCs with graphics displays of varying resolution and color depths, mobile telephones, handheld devices, devices for speech for input or output, and so on. 

@83. resolution /,rezə'lu:ʃən/ n. =clearness 清晰 the power of a television, camera, Micro-scope etc to give a clear picture of things, or a measure of this. (电视、照相机、显微镜的)清晰度;分辨率@

HTML is an application of the standardized Gerneralized Markup language (SGML), a system for defining structured document types and markup language to represent instance of those document types (ISO, 1986). 

HTML is one such markup language.

Figure 30.2 shows a portion of an HTML page (a) and the corresponding page viewed through a Web browser (b).

Links are specified in the HTML file using an HREF tag and the resulting display highlights the linked text by underlining them. 

In many browsers, moving the mouse over the link changes the cursor to indicate that the text is a hypelink to another document. 

@ 84.cursor/'kæʃə/ n. a mark or a small light which can be moved around a computer screen to show where you are working.电脑的光标@

30.2.3  Uniform Resource Locators

 URL  A string of alpha-numeric character that represents the location or address of a resource on the Internet and how that resource should be accessed. 

@85. alpha-numeric/,ælfənju:'merik/ adj. using letters and numbers 字母;数字(混合的);文数式的;@

@86. location /ləu'keiʃən/ n. the act of finding the position of something 定位;@

URLs define uniquely where documents (resources ) can be found on the Internet.

Other related terms that may be encounted are URIs and URNs.

@87. encounter/in'kauntə/ vt. to experience problems, difficulties, or opposition when you are trying to do something 遇到;@

Uniform Resource Identifiers (URIs)are the generic set of all names/ address that refer to Internet resources.

Uniform Resource Names (URN) also designate a resource on the Internet, but do so using a persistent, location-independence name.

@88.persistent /pə'sistənt/ adj. continuing to exist or happen, especially for longer than is usual or desirable. 持续存在(发生)的@

URNs  are very general and rely on name lookup services and therefore dependent on additional services that are not always generally available (Sollins and Masinter, 1994)

URLs,  on the other hand, identify a resource on the Internet using a scheme based on the resource's location.

URLs are the most commonly used identification scheme and are the basic for HTTP and the Web.

The syntax of a URL is quite simple and consists of three basic parts: the protocol used for connection, the host name, and the path name on that host where the resource can be found.

In addition, the URL can optionally specify the port through which the connection to the host should be made (default 80 HTTP), and a query string,

which is one of the primary methods for passing data from the client to the server (for example, to a CGI  script).

The syntax of a URL is as follows: 

<protocol>://<host>[:<port>]/absolute_path [? arguments]

The <protocol> specifies the mechanism to be used by the browser to communicate with the resource.

Common access methods are HTTP, S-HTTP (secure HTTP), file(load file from a local disk), FTP, mailto (send mail to specified mail address), Gopher, NNTP, and Telnet. 

For example:   http:// www.w3.org/MarkUp.html

 is a URL that identifies the general home page for HTML information at W3C.

The protocol is HTTP, the host is www.3.org, and the virtual path of the HTML file is /MarkUp/MarkUp.html.

We will see an example of passing a query string as an optional set of arguments as part of the URL in Section 30.4.

转载于:https://www.cnblogs.com/666638zhangqiang/p/4630515.html