Beruflich Dokumente
Kultur Dokumente
Table of Contents
Introduction to the World Wide Web, 15.3. . . . . . . . . Contents: . . . . . . . . . . . . . . References: . . . . . . . . . . . . . . What is Internet programming? . . . . . . . . . . Puzzle x Lego . . . . . . . . . . . . . . Is the web development like putting a puzzle together? . . . . Examples: . . . . . . . . . . . . . . If not a puzzle, what then? . . . . . . . . . . What is web application? . . . . . . . . . . . Web application examples . . . . . . . . . . . A straight HTML request - the most basic example of a web application A slightly more complex example . . . . . . . . . Much more complex example . . . . . . . . . . Technologies for web applications . . . . . . . . . . Goal of the lecture . . . . . . . . . . . . . Historical remarks . . . . . . . . . . . . . History of the World Wide Web . . . . . . . . . . History of Hypertext . . . . . . . . . . . . Data on the Web . . . . . . . . . . . . . . Some data types . . . . . . . . . . . . . HTML - HyperText Markup Language . . . . . . . . . HTMLs childhood . . . . . . . . . . . . The Challenges facing HTML . . . . . . . . . . W3C HTML Activity . . . . . . . . . . . . SGML - Standard Generalized Markup Language . . . . . . SGML basics - elements . . . . . . . . . . . SGML basics - attributes . . . . . . . . . . . SGML basics - entities . . . . . . . . . . . . SGML Document Type Definition (DTD) . . . . . . . MathML, an example of SGML application . . . . . . . Basics HTML tags . . . . . . . . . . . . . Document head . . . . . . . . . . . . . Document body . . . . . . . . . . . . . Block-level elements . . . . . . . . . . . . Block-level elements - examples . . . . . . . . . . Tables . . . . . . . . . . . . . . . Tables - example . . . . . . . . . . . . . Text-level elements . . . . . . . . . . . . Linking to other HTML documents . . . . . . . . . . URI - Universal Resource Identifier . . . . . . . . . URL . . . . . . . . . . . . . . . . Including objects, images, and applets into HTML . . . . . . Including an image . . . . . . . . . . . . . Including an applet . . . . . . . . . . . . . Including generic object . . . . . . . . . . . Note . . . . . . . . . . . . . . . Examples of included objects . . . . . . . . . . Extending functionality of the Browser . . . . . . . . . Java . . . . . . . . . . . . . . . . Active-X . . . . . . . . . . . . . . . Exposing the Browser API, Client-side Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 9 10 10 10 11 12 13 13 15 16 16 16 17 17 18 18 18 19 19 19 19 20 20 21
notes.html
-i-
15 Mar 2001
JavaScript VBScript
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
21 21
- ii -
References:
World Wide Web: Beyond the Basics Abrams, Marc. Prentice-Hall, 1998, ISBN 0-13-954785-1 (draft is available at http://ei.cs.vt.edu/~wwwbtb/book/) Internet and the World Wide Web How to Program Deitel, Harvey M., Deitel, Paul J., Nieto, T. R. Prentice-Hall, 2000, ISBN 0-13-016143-8 Opeta itsellesi WWW -ohjelmointi Kykk, S. wwwohjel.pdf W3C - World Wide Web Consortium A reference material for latest developments and recommendations for the WWW. There you find, among others: HTML 4.01 Recommendation. [LUT copy: HTML, postscript, PDF] Introduction to HTML and URLs A comprehensive introduction to HTML, that can be used also as a light tutorial. This introduction is kept very up to date, and discusses HTML 4.0, XHTML, and CSS. A Beginners Guide to HTML [LUT copy: HTML, PDF] Brief but contentful guide from one of originators of WWW, NCSA.
notes.html
-1-
15 Mar 2001
1. We take only part of this vast number of technologies - we will concentrate on technologies related to World Wide Web. 2. We step back from the realm of specific technologies and and focus on a general survey of web application development. Due to the first restriction, rather than Internet programming, the lecture should bear the title Web application development.
Puzzle x Lego
Examples:
1. CGI, ASP and Servlets all serve the same basic function. They perform server-side processing. 2. Similarly CORBA, DCOM and enterprise Java Beans specify how to talk to distributed objects. 3. Likewise XML, HTML, SGML, XSL and CSS are all similar tools for marshaling and displaying data across a network.
-2-
notes.html
-3-
15 Mar 2001
You could see from previous examples that myriad of technologies can be used to perform various tasks. There are literally hundreds of technologies and tools used throughout this simple process. However, regardless of how many technologies are involved in a project, for the most part they can all be placed into one of four conceptual categories. 1. 2. 3. 4. The display layer (usually a web browser) The communication layer The middleware layer The data layer
As such, web technologies within the same categories can be used interchangeably in MOST situations. Choosing one or the other may often be more of a bureaucratic/administrative/standards decision than a technical one. Rather than understanding each technology on its own, we need only understand the categories into which individual technologies fall. So when you confront a new web development technology and you can place it in one of these categories, you will immediately understand what it is, what it does, and probably most of how it does it.
-4-
During the lecture you will get a framework in which to understand all existing technologies you come across and all future technologies which come out. We will survey technologies in terms of which categories they fit into and how to understand the requirements and functions of those categories. We will also pick some of the most used technologies and look at them in more detail (circled in red).
Historical remarks
History of the World Wide Web
1858 The Atlantic cable of was established to carry instantaneous communications across the ocean for the first time.
notes.html
-5-
15 Mar 2001
... 1957 President Dwight D. Eisenhower saw the need for the Advanced Research Projects Agency (ARPA) after the Soviet Unions launch of Sputnik. ... 1989 Tim Berners-Lee, a researcher of European Particle Physics Laboratory (CERN), conceives idea of World Wide Web resulting from "a need for a collaborative knowledge-sharing tool" to support scientific work in an international context 1991 CERN releases the World Wide Web globally; Minnesota University releases Gopher as a rival to the WWW 1992 First version of the HTML 1993 Development of first graphical browser Mosaic in National Center for Supercomputing Applications (NCSA) 1994 Former Mosaic developer Marc Andersen left NCSA to establish a new company - Netscape was born Version 2.0 of the HTML - first HTML standard World Wide Web Consortium (W3C) has been established in order to promote standards of the Web 1995 SUN Microsystems releases the platform-independent Java language and the HotJava browser written using it. 1996 Version 3.2 of the HTML - tables, applets, text-flow around images, superscripts and subscripts SUN releases its JavaStation network computer 1997 Version 4.0 of the HTML - includes multimedia features, UNICODE support, for displaying the worlds various languages, and features that help people with disabilities use the Net 1998 W3C releases the specifications for XML (Extensible Markup Language) version 1.0, which will make it easy to expand future web pages. 1999 HTML 4.01 Recommendation. The last version of HTML, development of HTML has ended. 2000 XHTML 1.0 Specification released. HTML rewriten as XML application. XHTML Modularization, a further step to make HTML more flexible.
History of Hypertext
WWW is a hypertext or, more precisely, hypermedia system. Hypertext has been conceived long time before the Web was born. Underlying notion of hypertext as multi-sequentially read text is perfectly embodied by any scholarly text. Medieval System of marginalia 1945 Memex, a photo-electrical-mechanical device, which could make and follow links between documents on microfiche 1965 Ted Nielsen coined the terms hypertext and hypermedia to describe links to other texts embedded in a text 1967 A team of researchers led by Dr. Andries van Dam at Brown University develop the first working hypertext-based system called Hypertext Editing System
-6-
1981 Xanadu: Ted Nielsen conceived the idea of universal document database that allow addressing of any substring of any document from any other document. Unfortunately, it has never been implemented 1985 Xerox released NoteCards, a LISP-based hypertext system 1986 OWL-Guide, a hypertext system developed for the Macintosh 1987 Bill Atkinson of Apple Computers introduced HyperCard
All of the web technologies at the Data Layer define, describe, or standardize one or more of these characteristics.
notes.html
-7-
15 Mar 2001
HTMLs childhood
The genesis of HTML was firmly rooted in simplicity NCSAs Mosaic popularized the Web Most people dont think structurally Tags as formatting instructions Tag Soup Standardization efforts attempt to stem the tide
-8-
Attributes have a type, but the values have no meaning in SGML (they are given a meaning by the SGML application)
... The Prime Minister of Italy, ±, will ... Built-in - for unusual characters
© Ç Þ Publishing Languages Mathematics
notes.html
-9-
15 Mar 2001
Sample document:
<Part> <Title align="center">Hypertext</Title> <Author>Ted Nielsen</Author> <Sect> <Subtitle>Xanadu</Subtitle> <Par>Universal document database that allow ...</Par> <Par>... </Sect> </Part>
- 10 -
Every HTML document should contain certain standard elements. The required elements are: <html></html> encloses the entire document and defines it as HTML document. <head></head> comes after the opening <html> tag and contains the <title>. <title></title> contains the name of the document and must be enclosed by <head> tags. <body></body> contains all the rest of the document. The minimal HTML document could contain just those elements (such document, however, will remain empty on screen, since its body is empty) Example 1: Minimal HTML document
<html> <head> <title>Internet programming</title> </head> <body> </body> </html>
Document head
The head element contains general information, or meta-information, about the document. What element can appear in the head depends on HTML version. Some elements: <title> The title of the document. All document must have a title. <base> A record of the original URI of the document: this allows you to move the document to a new location and have relative URIs access the appropriate place with respect to the original URI. <link> Defines the relationship(s) between this document and another or others. A document can have several <link> elements. <meta> A container for document metainformation. <style> Stylesheet instructions, written in a stylesheet language. Stylesheet instructions specify how the document should be formatted for display. <script> A code of client-side script in the document. Example languages are JavaScript and VBScript. ...
notes.html
- 11 -
15 Mar 2001
Document body
The body element contains the actual content of the page, in other words, that what we want to show on the page. There are several basic types of elements: block-level elements describing a structure of the document, as for example <hn> for headings, <p> for marking paragraphs, ... text-level elements for marking a style of the text, either logical (e.g. <em>, <strong>,...) or physical (<i>, ...) Character-level elements and character references. Character references or entities have two functions: escaping special characters (e.g. write < to get "<" on the screen) displaying other characters not available in the plain ASCII character set (e.g. write ¥ to get japanise currency symbol , or ° for degree symbol ) hypertext anchors
- 12 -
Internet programming
Welcome! And this is the second paragraph.
Block-level elements
<hn> 6 levels of headings <p> Paragraphs <pre> Generates text in a fixed-width font. This element also preserves spaces, new lines, and tabs. <blockquote>, <q> Lengthy quotations in a separate block on the screen. Most browsers generally change the margins for the quotation to separate it from surrounding text. Wrongly used to indent text! <br>, <hr> Forced line breaks and horizontal lines. <sub>, <sup> Subscripts and superscripts. <ul>, <ol>, <dl>, <li> Unnumbered, numbered, and definition lists. You can nest lists too. <table> ...
notes.html
- 13 -
15 Mar 2001
Example 1: Lists
<ol> <li> A few New England states: <ul> <li> Vermont <li> New Hampshire <li> Maine </ul> <li> Two Midwestern states: <ul> <li> Michigan <li> Indiana </ul> </ol>
1. A few New England states: Vermont New Hampshire Maine 2. Two Midwestern states: Michigan Indiana
NCSA NCSA, the National Center for Supercomputing Applications, is located on the campus of the University of Illinois at Urbana-Champaign. Cornell Theory Center CTC is located on the campus of Cornell University in Ithaca, New York.
- 14 -
Example 3: Blockquote
<p>Do not misuse quotations.</p> <blockquote> <p>Blockquote is intended for lengthy quotations in a separate block on the screen. Most browsers generally change the margins for the quotation to separate it from surrounding text. </p> <p>Do not use them to merely indent text. Indenting does not need to hold in general.</p> </blockquote>
Do not misuse quotations. Blockquote is intended for lengthy quotations in a separate block on the screen. Most browsers generally change the margins for the quotation to separate it from surrounding text. Do not use them to merely indent text. Indenting does not need to hold in general.
Tables
Tables have been included into HTML specification in version 3.2. Until then, authors had to carefully format their tabular information within <pre> tags, counting spaces and previewing their output. Tables are very useful for presentation of tabular information as well as a boon to creative HTML authors who use the table tags to present their regular Web pages, despite using tables for layout is not recommended. A table has heads where you explain what the columns/rows include, rows for information, cells for each item. Table Elements Element <table> ... </table> Description defines a table in HTML. If the border attribute is present, your browser displays the table with a border.
<caption> defines the caption for the title of the table. The default position of the ... title is centered at the top of the table. The attribute </caption> align="bottom" can be used to position the caption below the table. NOTE: Any kind of markup tag can be used in the caption. <tr> ... </tr> specifies a table row within a table. You may define default attributes for the entire row: align (left, center, right) and/or valign (top, middle, bottom). See Table Attributes at the end of this table for more information. defines a table header cell. By default the text in this cell is bold and centered. Table header cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information. defines a table data cell. By default the text in this cell is aligned left and centered vertically. Table data cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information.
notes.html
- 15 -
15 Mar 2001
Tables - example
Example 1: Simple table
<table> <caption> caption contents </caption> <tr> <th> first header cell contents </th> <th> last header cell contents </th> </tr> <tr> <td> first row, first cell contents </td> <td> first row, last cell contents </td> </tr> <tr> <td> last row, first cell contents </td> <td> last row, last cell contents </td> </tr> </table>
caption contents first header cell contents last header cell contents
first row, first cell contents first row, last cell contents last row, first cell contents last row, last cell contents
Text-level elements
Logical: <dfn> for a word being defined. Typically displayed in italics.(WWW stands for World Wide Web) <em> for emphasis. Typically displayed in italics. <cite> for titles of books, films, etc. Typically displayed in italics. <code> for computer code. Displayed in a fixed-width font. <kbd> or user keyboard entry. Typically displayed in plain fixed-width font. (Enter password:) <strong> for strong emphasis. Typically displayed in bold. <var> or a variable, where you will replace the variable with specific information. Typically displayed in italics. (rm filename deletes the file) Physical: <b> bold text <i> italic text <tt> typewriter text, e.g. fixed-width font
- 16 -
<a href="whereto">anchor</a> for linking to an object with URI "whereto" <a name="thistext> where the identifier "thistext" is used to name the anchored text as the possible target of a hypertext link. Named anchors can be targeted, from within the same or other document using <href> prepending a #. From the same document:
<a href="#thistext">Poisonous mushrooms</a>
URI Uniform Resource Identifier. The generic set of all names/addresses that are short strings that refer to resources. URL Uniform Resource Locator. The set of URI schemes that have explicit instructions on how to access the resource on the Internet. URN Uniform Resource Name. 1. An URI that has an institutional commitment to persistence, availability, etc. Note that this sort of URI may also be a URL. See, for example, PURLs. 2. A particular scheme, urn, intended to serve as persistent, location-independent, resource identifiers.
URL
A URL includes the type of resource being accessed (e.g., Web, gopher, FTP), the address of the server, and the location of the file. The syntax of URL is:
protocol://host.domain[:port]/path/filename
where protocol is one of file a file on your local system ftp a file on an anonymous FTP server
notes.html
- 17 -
15 Mar 2001
http a file on a World Wide Web server gopher a file on a Gopher server WAIS a file on a WAIS server news a Usenet newsgroup telnet a connection to a Telnet-based service The protocol is sometimes called scheme. The port number can generally be omitted.
Including an image
In addition to src attribute, you should include two other attributes on <img> tags to tell your browser the size of the images it is downloading. The height and width attributes let your browser set aside the appropriate space for the images as it downloads the rest of the file. Some web browsers -- primarily the text-only browsers such as Lynx -- cannot display images. HTML provides a mechanism to tell readers what they are missing on your pages if they cant load images. The alt attribute lets you specify text to be displayed instead of an image. For example:
<img src="UpArrow.gif" alt="Up">
Including an applet
All Java-enabled browsers support the APPLET element, which allows designers to embed a Java applet in an HTML document. It has been deprecated in favor of the OBJECT element.
<applet code="HelloWorld.class" width="150" height="100"> Java applet that draws Hello world string </applet>
or
<object codetype="application/java" classid="HelloWorld.class" width="150" height="100"> Java applet that draws Hello world string </object>
Initial values may be supplied to the applet via the PARAM element.
- 18 -
Another element used to include objects into web pages is EMBED element. The element is used to embed a plugin into a document. It has been introduced by Netscape in version 2.0. It is also supported by Internet Explorer version 3.0 and higher.
Note
Despite the OBJECT element is specified in W3C recommendation, even new versions of major browsers do not seem to support it. Thus, in practice, you have to use "traditional" IMG, APPLET and EMBED elements.
notes.html
- 19 -
15 Mar 2001
Plug-ins are proprietary software tools that are browser aware and of which the browser is aware. They can be executed by the browser when needed and can take advantage of the HTTP pipeline that the browser maintains. Some of the most notable plug-in packages include Java, Real Audio, Real Video, Shockwave, and Acrobat
Java
One plug-in that was actually integrated into the browsers almost as soon as it was released, was Java from Sun Microsystems. The Java plugin run the molecule showing Java applet. Java is a programming language that can be used by anyone to code add on features that would be executed within the context of the browser as so called applets. The browsers added Java Virtual Machines to interpret the Java code downloaded from web servers. We will have a closer look to Java in later lecture, when we will talk about client-side programming.
Active-X
To a certain degree, we can also think of client-side Active-X components as plug-ins. Active-X technology allows web browsers on Microsoft systems to leverage the vast resource of Windows. Like Java applets, Active-X components can be instantiated within the context of the web browser itself making it appear that the web browser is providing the functionality when in fact the Active-X component is simply piggy-backing off the browser. Since any COM (Component Object Model) object in Windows can be an Active-X control, almost every Windows resource can thus be embedded in the browser window. Controls can be as simple as a custom stock ticker or as complex as an application like Microsoft Excel.
Beware that Active-X is a Microsoft-specific technology so it may not ever work on Netscape or on Macintosh.
- 20 -
JavaScript
Netscape 2.0 introduced JavaScript (initially LiveScript), a distant cousin of the Java language, as a means for achieving some special effects in the web browser without actually having to resort to a plug-in technology. Soon after the release of JavaScript by Netscape, Microsoft released their own semi-compatible version called JScript in Internet Explorer 3.0. We will be more concerned with JavaScript later.
VBScript
Microsoft released VBScript that leveraged the Visual Basic programming language to do the same thing as JavaScript. Last update: Thu Mar 15 12:11:33 EET 2001
notes.html
- 21 -
15 Mar 2001