chapter 16

31
Chapter 16 The World Wide Web

Upload: brooke-curtis

Post on 02-Jan-2016

15 views

Category:

Documents


0 download

DESCRIPTION

Chapter 16. The World Wide Web. Chapter Goals. Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several specific HTML tags and their purposes Write basic HTML documents. Chapter Goals. - PowerPoint PPT Presentation

TRANSCRIPT

Chapter 16

The World Wide Web

16-2

Chapter Goals

• Compare and contrast the Internet and the World Wide Web

• Describe general Web processing

• Describe several specific HTML tags and their purposes

• Write basic HTML documents

16-3

Chapter Goals

• Describe the processing of Java applets and Java server pages

• Compare and contrast HTML and XML

16-4

The World Wide Web

• The Web The network of computers supporting HTML protocol – Client machines running browser SW– Server machines running web server SW

• Web page A multimedia document stored on a web server and distributed to a client

• Link A connection between one web page and another that can be used to “move around” as desired

16-5

The World Wide Web

• Website A collection of related web pages

• The Internet makes communication possible

• The Web makes communication easy

15-6

Web Machines

• Client/server model

Figure 15.1 Client/Server interaction

The Web is Stateless

• After a page is served to a client, the server forgets who you are

• A mechanism is needed to remember “state” information

• One mechanism is a “Cookie”

• There are other mechanisms also

16-7

16-8

Cookies

• Cookie A small text file that a web server stores on your local computer’s hard disk– A cookie contains information about your visit

to the site – Cookies can be used

• to determine number of unique visitors to the site• to customize the site for your future visits• to implement shopping carts that can be

maintained from visit to visit

16-9

Web Browser

• Browser A software tool that issues the request for the web page we want and displays it when it arrives

• User requests an HTML webpage from another computer (the web server)

• The web server responds by sending an HTML document back to the user’s computer

16-10

Web Server

• Web server The computer that is set up to respond to web requests

• Web address The core part of a Uniform Resource Locator, or URL, which uniquely identifies the page you want. Example:http://www.flc.losrios.edu/~ross/

CISC310InPersonBasicInfo.htm

16-11

Web Browser

Figure 16.2 A browser retrieving a Web page

16-12

HTML

• Web pages are created (or built) using a language called the Hypertext Markup Language, or HTML

• The term Markup Language comes from printing industry, where it is used to define the format of a document using tags

• Hypertext refers to the links

16-13

Mark-Up

Figure 16.2 A marked-up document

16-14

Cooked HTML

Figure 16.3 The Student Dynamics Web page as displayed in Netscape Navigator

16-15

Raw HTML

Figure 16.4The HTML document defining the Student Dynamics Web page

16-16

HTML Tags

• Tags are enclosed in angle brackets (<. . . >)

• Tags are often used in pairs, with a start tag such as <BODY> and a corresponding end tag with a / before the element name, such as </BODY>

16-17

Basic HTML Formatting

• The paragraph tags (<P> . . . </P>)

• The center tags (<CENTER> . . . </CENTER>)

16-18

Basic HTML Formatting

• The B, I, and U elements for bold, italic, or underlined

• The <HR> tag inserts a horizontal rule (a line) across the page

16-19

Images and Links

• Image Tags

– Downloads and image file and displays it

– <IMG SRC = "myPicture.gif">

16-20

Images and Links (cont.)

• A link or “anchor”

• HREF tag specifies the URL of the destination document.

For example

<A HREF = "http://duke.csc.villanova.edu/docs/"> Documentation Central!</A>

Static Web Pages

• When HTML was first developed, there was no way to interact with the information and pictures presented in a web page

• The page did not change, it was static

16-21

16-22

Interactive Web Pages

• Code must run somewhere to provide a dynamic webpage

• There are three main ways to do this– Client side scripting (Javascript)– Client side applets (ActiveX, Java Applets)– Server side scripting

16-23

Client Side JavaScript

• Code can be embedded in the HTML, then, interpreted and executed by the browser

• This allows the page to change as the user interacts with it.

• Example: WebPages with menus

16-24

Java Applets

• Java applet A program that is designed to be embedded into an HTML document and transferred over the Web to someone who wants to run the program

An applet is embedded into an HTML document using the APPLET tag

<APPLET code="MyApplet.class" width=250 height=150 ></APPLET>

16-25

Java Applets

• Java applet programs are compiled into Bytecode, a low-level representation of a program that is not the machine code for any particular type of CPU

• Java applets have more powerful processing than scripts

• Example: Animations– http://www.cs.jhu.edu/~goodrich/dsa/trees/avltree.html

16-26

Server Side Scripts

• Code can be embedded in the HTML, but processed on the server, then removed before the final HTML page is sent.

• This allows customized pages to be created.

• Example: a Google search result page

16-27

Server Side Scripts

• A JSP scriptlet is encased in special tags beginning with <% and ending with %>

Page 488

16-28

Server Side Scripts

• Note that JSPs are executed on the server side where the web page resides

• By the time it arrives at your computer, all active processing has taken place, producing a static (though dynamically created) web page

• JSPs are particularly good for coordinating the interaction between a web page and an underlying database

16-29

XML

• HTML has predefined tags and each tag has its own meaning

• Most of HTML tags are concerned with formatting.

• There is nothing about HTML tags that describes the true content of a document

16-30

XML

• The Extensible Markup Language, or XML, allows the creator of a document to describe its contents by defining his or her own set of tags

• XML allows new data types to be defined from existing data types

16-31

XML

• Like HTML, an XML document is made up of tagged data

Figure 16.5 An XLML document containing data about books