McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW.

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
©Brooks/Cole, 2003 Chapter 9 Programming Languages.
PART 6 Application Layer
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
CS 1302 Computer Networks — Unit - 5 — — Application Layer —
Application Layer Pertemuan 25 Matakuliah: H0484/Jaringan Komputer Tahun: 2007.
CSC 450/550 Part 6: The Application Layer Example: The World Wide Web.
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
Java Applets A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Introduction to Java Applets Outline 3.1 Introduction 3.2 Sample Applets from the Java 2.
IST 535 Week 1 Class Orientation / Review of Web Basics.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives.
1 Static Web Pages Websites on Servers (The Big Picture) –Apache Tomcat can support static web pages –Primarily intended to support servlets and JSP –Some.
Chapter 27 HTTP and WWW.
Definitions, Definitions, Definitions Lead to Understanding.
HTML Companion. Lecture Objectives Learn about HTML. Know basic HTML tags.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
McGraw-Hill©The McGraw-Hill Companies, Inc., 2001 Chapter 25 TCP/IP Protocol Suite: Part 2, Application Layer.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Applets Chapter 17.  Java’s big splash onto the scene came in the mid 90’s. The people at Sun Microsystems had managed to work java programs into Web.
F-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 2 Application Layer.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
W orld W ide W eb Client/Server design using TCP/IP Incorporates Other Client/Server Systems –ftp –gopher –mail Server runs on port 80, named httpd, exchanges.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
Introduction to Computers 12/6/ BEGINNING HTML DESIGNING YOUR OWN WWW PAGES.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
Creating a Java Application and Applet
1 2/16/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: Intro to HTML and Basic Web Page Design.
CS 100 Introduction to Web Page Construction and HTML.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 HTML. 2 Full forms WWW – world Wide Web HTTP – Hyper Text Transfer Protocol HTML – Hyper Text Markup Language.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Introduction to Java Applets Will not cover Section 3.7 Thinking About Objects: Identifying.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
WWW and HTTP King Fahd University of Petroleum & Minerals
HTTP – An overview.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CASE STUDY -HTML,URLs,HTTP
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 27 WWW and HTTP.
PART 6 Application Layer
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP Protocol Suite: Part 2, Application Layer
Presentation transcript:

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW

McGraw-Hill©The McGraw-Hill Companies, Inc., HTTP Transaction Request Message Response Message Headers

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 HTTP uses the services of TCP on well-known port 80. Note:

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.1 HTTP transaction

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.2 Request message

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.3 Request line

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.4 URL

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.5 Response message

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.6 Status line

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.7 Header format

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.8 Headers

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in GIF and JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Fig. 27.9, next slide).

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure 27.9 Example 1

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 2 This example retrieves information about a document. We use the HEAD method to retrieve information about an HTML document (see the next section). The request line shows the method (HEAD), URL, and HTTP version (1.1). The header is one line showing that the client can accept the document in any format (wild card). The request does not have a body. The response message contains the status line and five lines of header. The header lines define the date, server, MIME version, type of document, and length of the document (see Fig , next slide). Note that the response message does not contain a body.

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Example 2

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 HTTP version 1.1 specifies a persistent connection by default. Note:

McGraw-Hill©The McGraw-Hill Companies, Inc., World Wide Web Hypertext and Hypermedia Browser Architecture Static Document/HTML Dynamic Document/CGI Active Document/Java

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Distributed services

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Hypertext

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Browser architecture

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Categories of Web documents

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Static document

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Boldface tags

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Effect of boldface tags

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Beginning and ending tags

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Table 27.1 Common tags Beginning Tag Ending Tag Meaning Skeletal Tags Defines an HTML document Defines the head of the document Defines the body of the document Title and Header Tags Defines the title of the document Defines the title of the document

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Table 27.1 Common tags (continued) Beginning Tag Ending Tag Meaning Text Formatting Tags Boldface Italic Underlined Subscript Superscript Data Flow Tag Centered Line break

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Table 27.1 Common tags (continued) Beginning Tag Ending Tag Meaning List Tags Ordered list Unordered list An item in a list Image Tag Defines an image Hyperlink Tag Defines an address (hyperlink) Executable Contents The document is an applet

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 3 This example shows how tags are used to let the browser format the appearance of the text. First Sample Document ATTENTION You can get a copy of this document by: Writing to the publisher Ordering online Ordering through a bookstore

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 4 This example shows how tags are used to import an image and insert it into the text. Second Sample Document This is the picture of a book:

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 5 This example shows how tags are used to make a hyperlink to another document. Third Sample Document This is a wonderful product that can save you money and time. To get information about the producer, click on Producer

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Dynamic document

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 6 Example 6 is a CGI program written in Bourne shell script. The program accesses the UNIX utility (date) that returns the date and the time. Note that the program output is in plain text. #!/bin/sh # The head of the program echo Content_type: text/plain echo # The body of the program now='date' echo $now exit 0

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 7 Example 7 is similar to Example 6 except that program output is in HTML. #!/bin/sh # The head of the program echo Content_type: text/html echo # The body of the program echo echo Date and Time echo now='date' echo $now echo echo exit 0

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 8 Example 8 is similar to Example 7 except that the program is written in Perl. #!/bin/perl # The head of the program print "Content_type: text/html\n"; print "\n"; # The body of the program print " \n"; print " Date and Time \n"; print " \n"; $now = 'date'; print " $now \n"; print " \n"; print " \n"; exit 0

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Active document

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Skeleton of an applet

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Instantiation of the object defined by an applet

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure Creation and compilation

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Figure HTML document carrying an applet

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 9 In this example, we first import two packages, java.awt and java.applet. They contain the declarations and definitions of classes and methods that we need. Our example uses only one publicly inherited class called First. We define only one public method, paint. The browser can access the instance of First through the public method paint. The paint method, however, calls another method called drawString, which is defined in java.awt.*. import java.applet.*; import java.awt.*; public class First extends Applet { public void paint (Graphics g) { g.drawString ("Hello World", 100, 100); } }

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 10 In this example, we modify the program in Example 9 to draw a line. Instead of method drawString, we use another method called drawLine. This method needs four parameters: the x and y coordinates at the beginning of the line and the x and y coordinates at the end of the line. We use 0, 0 for the beginning and 80, 90 for the end. import java.applet.*; import java.awt.*; public class Second extends Applet { public void paint (Graphics g) { g.drawLine (0, 0, 80, 90); } }