Programming the Web 06CS73 INTRODUCTION AND OVERVIEW. Dr. Kavi Mahesh, PESIT, Bangalore. Textbook: Programming the World Wide Web

Similar documents
1.1 A Brief Intro to the Internet

1.1 A Brief Intro to the Internet

1.1 A Brief Intro to the Internet

The World Wide Web. Internet

Web Engineering (CC 552)

Outline. Web browsers & Web servers

3. WWW and HTTP. Fig.3.1 Architecture of WWW

WEB TECHNOLOGIES CHAPTER 1

Programming the World Wide Web by Robert W. Sebesta

Web Programming Paper Solution (Chapter wise)

COSC 2206 Internet Tools. The HTTP Protocol

Notes beforehand... For more details: See the (online) presentation program.

CS WEB TECHNOLOGY

Jeff Offutt SWE 642 Software Engineering for the World Wide Web

Table of Contents WWW. WWW history (2) WWW history (1) WWW history. Basic concepts. World Wide Web Aka The Internet. Client side.

EEC-682/782 Computer Networks I

Global Servers. The new masters

Web Development. Lab. Bases de Dados e Aplicações Web MIEIC, FEUP 10/11. Sérgio Nunes

CSC 551: Web Programming. Spring 2004

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

World Wide Web. Before WWW

Web Design. Basic Concepts

Govt. of Karnataka, Department of Technical Education Diploma in Computer Science & Engineering. Fifth Semester. Subject: Web Programming

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

WWW Document Technologies

CITS3403 Agile Web Development 2019, Semester 1

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

From administrivia to what really matters

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

World Wide Web PROGRAMMING THE PEARSON EIGHTH EDITION. University of Colorado at Colorado Springs

SAS/IntrNet 9.3. Overview. SAS Documentation

Web Standards. Web Technologies. Web Standards. URI and URL

Fachgebiet Technische Informatik, Joachim Zumbrägel

Introduction to Internet, Web, and TCP/IP Protocols SEEM

Unraveling the Mysteries of J2EE Web Application Communications

CMPE 151: Network Administration. Servers

Impact. Course Content. Objectives of Lecture 2 Internet and WWW. CMPUT 499: Internet and WWW Dr. Osmar R. Zaïane. University of Alberta 4

Module 3 Web Component

13. Databases on the Web

Distributed Multitiered Application

CPET 581 E-Commerce & Business Technologies. Topics

A Brief History of the Internet

UNIT I. A protocol is a precise set of rules defining how components communicate, the format of addresses, how data is split into packets

Web Engineering. Basic Technologies: Protocols and Web Servers. Husni

Web Systems & Technologies: An Introduction

UR what? ! URI: Uniform Resource Identifier. " Uniquely identifies a data entity " Obeys a specific syntax " schemename:specificstuff

Web Systems & Technologies: An Introduction

Networking and Internet

How to work with HTTP requests and responses

The Internet and the World Wide Web. CIT 230 Web Design

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

Connecting with Computer Science Chapter 5 Review: Chapter Summary:

Web Technology. COMP476 Networked Computer Systems. Hypertext and Hypermedia. Document Representation. Client-Server Paradigm.

Internet Architecture. Web Programming - 2 (Ref: Chapter 2) IP Software. IP Addressing. TCP/IP Basics. Client Server Basics. URL and MIME Types HTTP

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

Web Architecture and Technologies

Semantic Web Lecture Part 1. Prof. Do van Thanh

Objectives. Connecting with Computer Science 2

Applications & Application-Layer Protocols: The Web & HTTP

How the Web Works. Chapter 1. Modified by Marissa Schmidt Pearson

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

2. Introduction to Internet Applications

Announcements Fawzi Emad, Computer Science Department, UMCP

Introduction. WWW history. Application concepts, WWW and HTTP Perspectives on (mobile) communications. Fredrik Alstorp Torbjörn Söderberg

Chapter 4: Networking and the Internet. Figure 4.1 Network topologies. Network Classifications. Protocols. (continued)

Chapter 4: Networking and the Internet

Agenda. INTRODUCTION TO WEB DEVELOPMENT AND HTML <Lecture 1> 1/20/2013. What is a Web Developer? Rommel Anthony Palomino Spring

Computational Web Portals. Tomasz Haupt Mississippi State University

KINGS COLLEGE OF ENGINEERING 1

Outline. Computer Center, CS, NCTU. Web hosting. Proxy. Basics Client-Server architecture HTTP protocol Static vs. dynamic pages Virtual hosts

Course Overview. SWE 432, Fall Design and Implementation of Software for the Web

CS631 - Advanced Programming in the UNIX Environment

SAS/IntrNet 9.2. Overview. SAS Documentation

Persistent systems. Traditional software: Data stored outside of program. Program

COPYRIGHTED MATERIAL. The Basics of HTML. What Is the World Wide Web?

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Hypertext Markup Language, or HTML, is a markup

Data Communication & Computer Networks MCQ S

HTML/CSS Essentials. Day Three Ed Crowley

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 1 Introduction to HTML, XHTML, and CSS

Chapter 2 FEATURES AND FACILITIES. SYS-ED/ Computer Education Techniques, Inc.

Introduction to the Internet. September 7, 2005 Lecture 1

A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University 2011 Pearson Prentice Hall ISBN

Web Design and Development ACS-1809

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

ICOM 5016 Database Systems. Database Users. User Interfaces and Tools. Chapter 8: Application Design and Development.

CHAPTER 7 WEB SERVERS AND WEB BROWSERS

HTTP Protocol and Server-Side Basics

Web Architecture AN OVERVIEW

MR AZIZUL ZAMRI BIN MUHAMED AMIN WEB : Your Logo

The Internet and the Web. recall: the Internet is a vast, international network of computers

The Internet and How It Works 12 11/21/2016. Define what a computer network is, and how networks are conceptually structured.

Introduction To Web Architecture

RESTful Services. Distributed Enabling Platform

UFCEKG Lecture 2. Mashups N. H. N. D. de Silva (Slides adapted from Prakash Chatterjee, UWE)

Creating Data Driven Websites with Dreamweaver CS4: Using ColdFusion, PHP or ASP

HTTP. Web. Web Web web

Chapter 10: Web Application Development. Informatics Practices Class XII. By- Rajesh Kumar Mishra. KV No.1, AFS, Suratgarh

Transcription:

Programming the Web 06CS73 INTRODUCTION AND OVERVIEW Dr. Kavi Mahesh, PESIT, Bangalore Textbook: Programming the World Wide Web Introduction: Internet and World-Wide Web Internet History Internet Protocols Toolkit for Web Programming Robert W. Sebesta 4 th Edition Pearson Education Internet History: The Internet originated in the form of ARPAnet in the late 1960s and early 1970s primarily for ARPA-funded research organizations. Later, BITnet and CSnet came up in the late 1970s and early 1980s. Email and file transfer for other institutions started with NSFnet in 1986 which initially connected five supercomputer centers. By 1990, it had replaced ARPAnet for non-military uses and became the network for all (by the early 1990s). NSFnet eventually became known as the Internet. What is the Internet A world-wide network of computer networks At the lowest level, since 1982, all connections use TCP/IP TCP/IP hides the differences among devices connected to the Internet Internet Protocols: Internet Protocol (IP) Addresses Every node has a unique numeric address Form: 32-bit binary number New standard, IPv6, has 128 bits (1998) Problem: By the mid-1980s, several different protocols had been invented (Telnet, FTP, Usenet, mailto, ) IP Addresses: 1

IP Addresses consist of four 8 bit numbers separated by periods. Organizations are assigned blocks of IP s which in turn assign to machines that need internet access. Eg: 191.57.126.0 to 191.57.126.255. Internet Protocols: Domain names Server-name portion of the URL is resolved into an IP address using the global, distributed Internet DB known as the domain name system, or DNS First domain is the smallest; last domain is the largest. The second domain name gives the domain of which the first domain is a part. Last domain specifies the type of organization DNS servers or name servers - convert fully qualified domain names to IPs Eg: vtu.ac.in vtu is hostname, which is a part of ac (academic) domain, which is a part of.in (India) domain. All document requests from browsers are routed to the nearest name server. Fully qualified domain names must be unique. Hostname: The hostname is the name of the server computer that stores the document. Note: URL s can never have embedded spaces. Eg: If San Jose is a domain name, it must be typed as San%20Jose. The World Wide Web: A possible solution to the proliferation of different protocols being used on the Internet Origins Tim Berners-Lee at CERN proposed the Web in 1989 Purpose: to allow scientists to have access to many databases of scientific work Document form: hypertext Pages? Documents? Resources? We ll call them documents Hypermedia more than just text images, sound, etc. Web or Internet: The Web uses one of the protocols, http, that runs on the Internet--there are several others (telnet, mailto, etc.). 2

Client-Server: Clients and Servers are programs that communicate with each other over the Internet A Server runs continuously, waiting to be contacted by a Client Each Server provides certain services Services include providing web pages A Client will send a message to a Server requesting the service provided by that server The client will usually provide some information, parameters, with the request Web-based systems: Server Web server E.g., Apache or IIS Client Web browser E.g., IE, FireFox, Web Browser: Browsers are clients - always initiate, servers react (although sometimes servers require responses) Mosaic - 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 1993 Most requests are for existing documents, using HyperText Transfer Protocol (HTTP) But some requests are for program execution, with the output being returned as a document Web Server: Provide responses to browser requests, either existing documents or dynamically built documents Browser-server connection is now maintained through more than one requestresponse cycle All communications between browsers and servers use Hypertext Transfer Protocol (HTTP) 3

Operation: Web servers run as background processes in the operating system. Monitor a communications port on the host, accepting HTTP messages when they appear Note: Default port is 80 Web servers have two main directories: 1. Document root (servable documents) 2. Server root (server system software) Document root is accessed indirectly by clients Its actual location is set by the server configuration file Requests are mapped to the actual location Virtual document trees, Virtual hosts, Proxy servers Web servers now support other Internet protocols Apache (open source, fast, reliable) Directives (operation control): ServerName ServerRoot ServerAdmin, DocumentRoot Alias Redirect DirectoryIndex UserDir Proxy Server The file structure of web server has 2 directives Document root and server root. The secondary areas from which documents can be served are called Virtual document trees. Secondary hosts are called virtual hosts. Some servers can serve documents that are in the document root of other machines called as PROXY SERVER. Internet Information Server: IIS - Operation is maintained through a program with a GUI interface 4

URL General form: scheme:object-address The scheme is often a communications protocol, such as telnet or ftp For the http protocol, the object-address is: fully qualified domain name/doc path For the file protocol, only the doc path is needed Host name may include a port number, as in zeppo:80 (80 is the default) URLs cannot include spaces or any of a collection of other special characters (semicolons, colons,...) The doc path may be abbreviated as a partial path The rest is furnished by the server configuration If the doc path ends with a slash, it means it is a directory HyperText Transfer Protocol: The protocol used by ALL Web communications. It has a Request Phase with a Form: HTTP method domain part of URL HTTP ver. Header fields blank line Message body An example of the first line of a request: GET /degrees.html HTTP/1.1 HTTP Methods: GET - Fetch a document POST - Execute the document, using the data in body HEAD - Fetch just the header of the document PUT - Store a new document on the server DELETE - Remove a document from the server HTTP Headers: There are four categories of header fields: General, request, response and entity. Common request fields: Accept: text/plain, Accept: text/*, If-Modified_since: date Common response fields: Content-length: 488, Content-type: text/html - Can communicate with HTTP without a browser - > telnet blanca.uccs.edu http GET /respond.html HTTP/1.1 Host: blanca.uccs.edu 5

HTTP Response Form: Status line Response header fields blank line Response body Status line format: HTTP version status code explanation Example: HTTP/1.1 200 OK (Current version is 1.1) Status code is a three-digit number; first digit specifies the general status Status Code 1 => Informational 2 => Success 3 => Redirection 4 => Client error 5 => Server error HTTP Response: Example HTTP/1.1 200 OK Date: Tues, 18 May 2004 16:45:13 GMT Server: Apache (Red-Hat/Linux) Last-modified: Tues, 18 May 2004 16:38:38 GMT Accept-ranges: bytes Content-length: 364 Connection: close Content-type: text/html, charset=iso-8859-1 Note: Both request headers and response headers must be followed by a blank line Web Programmer s Toolbox Document languages and programming languages: XHTML Plug-ins Filters XML Javascript Java, Perl, Ruby, PHP 6

XHTML To describe the general form and layout of documents XHTML document is a mix of content and controls Controls are tags and their attributes Tags often delimit content and specify something about how the content should be arranged in the document Attributes provide additional information about the content of a tag Creating XHTML Documents XHTML editors - make document creation easier Shortcuts to typing tag names, spell-checker, WYSIWYG XHTML editors Need not know XHTML to create XHTML documents Plugins and Filters Plug ins Integrated into tools like word processors, effectively converting them to WYSIWYG XHTML editors Filters Convert documents in other formats to XHTML Advantages of both filters and plug-ins: Existing documents produced with other tools can be converted to XHTML documents Use a tool you already know to produce XHTML Disadvantages of both filters and plug-ins: XHTML output of both is not perfect - must be fine tuned XHTML may be non-standard You have 2 versions of the doc: difficult to synchronize Multipurpose Internet Mail Extensions (MIME) Originally developed for email Used to specify to the browser the form of a file returned by the server (attached by the server to the beginning of the document) Type specifications Form: type/subtype Examples: text/plain, text/html, image/gif, image/jpeg MIME was developed to allow different kinds of documents to be sent using internet mail. 7

Server gets type from the requested file name s suffix (.html implies text/html) Browser gets the type explicitly from the server. Type/subtype. A list of MIME specifications is stored in the configuration files of every web server. Overview of Toolkit XML XHTML XML Javascript Perl Java PHP TCL, JSP, ASP.Net, etc. A meta-markup language Used to create a new markup language for a particular purpose or area Because the tags are designed for a specific area, they can be meaningful No presentation details A simple and universal way of representing data of any textual kind JavaScript A client-side HTML-embedded scripting language Only related to Java through syntax Dynamically typed and not object-oriented Provides a way to access elements of HTML documents and dynamically change them Java General purpose object-oriented programming language Based on C++, but simpler and safer Our focus is on applets, servlets, and JSP Perl Provides server-side computation for HTML documents, through CGI Perl is good for CGI programming because: Direct access to operating systems functions Powerful character string pattern-matching operations Access to database systems Perl is highly platform independent Perl is not just for CGI 8

PHP A server-side scripting language An alternative to CGI Similar to JavaScript Great for form processing and database access through the Web Web Programming How is it different from regular programming? Client-Server architecture Browser is the client Server may be remote Stateless programming Event-driven programming Client-Server Systems Server Stores data, files, content Takes input and requests from client Applies business logic to compute Sends results to client But, cannot contact client! Client Interacts with user Provides a GUI Accepts user input Validates input Displays results Interacts with server using a protocol Implications Program context in two possible parts Client-side and server-side Link may be broken Response may be delayed world wide wait Different platforms, etc. 9

Browser as GUI Implications Limited graphic abilities Easy to build GUI Many browsers Many versions Many idiosyncratic extensions Implications of Remote Server Implications Cost of server loop E.g., validation of user input Client-side validation Populating lists, menus, etc. in browser E.g., auto-completion Pre-fetching of data: AJAX Implications of Stateless Programming Implications Server does not maintain status Server cannot contact client! Session maintenance Session expired Client-side session data: unsafe! Implications of Event-Driven Programming Implications Server cannot wait in a loop User may not respond as expected User may navigate out at any point! No well-defined control structure User events trigger requests to servers Button click, menu selection, on-load, on-unload, etc. Enterprise Web Applications 3-tier/4-tier architecture Web server Browser client Database server 10

Applications server Provides scalability by performing computations, data validations, session maintenance, etc. Security in Web Applications Encryption HTTPS:// Cookies, history, etc. Phishing Virtual keyboards Data security Security issues in B2B Server-Side Programming XHTML and XML Perl and CGI PHP Java Server Pages/Servlets ASP ASP.Net / C#.Net / TCL Running Server-Side Programs CGI: one process per request Containers and components COM objects.net Run-time Java Servlets Java Beans / EJBs Application Servers Client-Side Programming XHTML Plug-ins Filters XML Javascript Flash, etc. 11

HTML: The Mother Tongue of the Web Standard formatting language Very simple Highly portable Learn HTML in 21 Minutes Need not know syntax Simplification of SGML Database Access Not extensible (only predefined tags) Very forgiving: e.g., missing closing tags No separation between data and rendering Text structure: <h1>, <table>, <p>, Rendering: <b>, <em>, <style>, Inconsistent syntax? <br> for new line for space character ODBC / JDBC Embed SQL statements in server-side code DB login / connect string: security issue Safer option: exec stored procedures 12