FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)

Slides:



Advertisements
Similar presentations
Overview Environment for Internet database connectivity
Advertisements

Java Script Session1 INTRODUCTION.
DT228/3 Web Development WWW and Client server model.
Web documents types 1. 2 Three basic types of web documents Static. A static web document resides in a file that it is associated with a web server. The.
PART 6 Application Layer
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Servlets and a little bit of Web Services Russell Beale.
Introduction to Web Database Processing
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
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.
Introduction to Web Interface Technology (CSE2030)
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Definitions, Definitions, Definitions Lead to Understanding.
Introduction to Web Interface Technology (CSE2030)
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Web Application Architecture and Communication. Displaying a Web page in a Browser
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Java Server Pages Softsmith Infotech.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Website Development with PHP and MySQL Saving Data.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction and Principles Web Server Scripting.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
WWW Programming Model. WWW Model The Internet WWW architecture provides a flexible and powerful programming model. Applications and content are presented.
WEB SERVER SOFTWARE FEATURE SETS
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
FALL 2004CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics (Web technologies: HTTP, CGI, Java applets; Middleware)
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
Section 10.1 Define scripting
Applications Active Web Documents Active Web Documents.
WWW and HTTP King Fahd University of Petroleum & Minerals
PHP / MySQL Introduction
Chapter 27 WWW and HTTP.
Web documents types.
CSI 4118 – UNIVERSITY OF OTTAWA
Presentation transcript:

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA2 Types of Web Pages Static Stored in file Unchanging Dynamic Formed by server Created on demand Output from a program Use Common Gateway Interface (CGI) technology

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA3 Types of Web Pages (cont) Active Executed at client Consists of a computer program Can interact with user Use Java technology

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA4 Summary of Web Document Types Web documents can be grouped into three categories depending on when the information in the document changes. The information in a static document remains unchanged until the author revises the document. The information in a dynamic document can change whenever a server receives a request for the document. Information displayed by an active document can change after the document has been loaded into a browser.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA5 CGI Technology URL specifies Location of Web server CGI program on that server Arguments to program Web server Uses TCP for communication Accepts HTTP request from client Runs specified CGI program Returns output to client

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA6 CGI Technology (cont) CGI program Performs arbitrary computation Often written in a scripting language Produces output file when run Starts output with header

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA7 Header in CGI Output Stops at first blank line Identifies Encoding used Type of document Format keyword: information

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA8 CGI Header Examples HTML document header Content Type: text/html Text document header Content Type: text/plain Redirection header Location: /over_here/item4

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA9 Example CGI Script Generates document Document contains three lines of text Header Blank line Document creation date

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA10 Parameters CGI programs can be parameterized URL can contain arguments that are passed to CGI program Question mark separates CGI path from arguments Server places information following question mark in environment variable QUERY_STRING

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA11 Example Environment Variables

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA12 Encoding Information in a URL Information that program stores between invocations: state information Information passed to browser in form of cookie Cookie consists of name/value pair Long term (persistent) or short term (session)

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA13 Long-Term State Information Program lifetime CGI program invoked by server Program exits after generating output To maintain persistent data Write to file on disk Read from file on disk

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA14 Long-Term State Information Client’s IP address in environment variable Check if address in file Respond to client

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA15 Short-Term State Information Each invocation of a dynamic document program can produce a document containing a new set of URLs Use new arguments in new URLs

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA16 Short-Term State Information Argument encodes number of times executed

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA17 Example of Script Execution Initial document Content-type: text/html This is the initial page. Click here to refresh the page. Resulting display This is the initial page. Click here to refresh the page.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA18 Example of Script Execution Generated output Content-type: text/html You have displayed this page 2 times. Click here to refresh the page. Resulting display You have displayed this page 2 times. Click here to refresh the page.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA19 Generated URL Values When it generates a document, a dynamic document program can embed state information as arguments in URLs. The argument string is passed to the program for the URL, enabling a program to pass state information from one invocation to the next.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA20 Server-Side Scripting ASP (Active Server Pages) JSP (Java Server Pages) PHP (Perl Helper Pages) ColdFusion

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA21 Server-Side Scripting Server-side scripting technologies allow a dynamic page to be created from a template or skeleton that contains embedded commands or program scripts. Instead of using a computer program to generate an entire page, an interpreter copies the page and replaces only the scripting commands.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA22 Continuously Changing Information Needed for Animations Rapid updates (e.g., stock prices) Achieved with two mechanisms Server push Active document

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA23 Server Push Technology Client forms connection Server sends updates repeatedly Impractical

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA24 Active Document Technology Server Sends computer program to client Client Runs program locally Program Controls display Interacts with user

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA25 Active Document Representation Desire Platform independence Efficient execution High-speed data transmission Late binding Consequence Compact representation Interpretive execution

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA26 Active Document Translation Compiler produces machine-independent binary Browser interprets binary

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA27 Java Technology Developed by Sun Microsystems Used for Conventional applications Active documents (applets) Includes Programming language Run-time system Class library

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA28 Java Language Characteristics High level General purpose Similar to C++ Object oriented Dynamic Strongly typed Statically type checked Concurrent

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA29 Java Run-Time Environment Characteristics Interpretative execution Automatic garbage collection Multi-threaded execution Internet access Graphics support

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA30 Java Library Classes for Graphics manipulation Low-level network I/O Interaction with a Web server Run-time system access File I/O Conventional data structures Event capture Exception handling

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA31 Choice of Graphics Interface Java includes an extensive graphics toolkit that consists of run-time support for graphics as well as interface software. The toolkit allows a programmer to choose a high-level interface, in which the toolkit handles details, or a low-level interface, in which the applet handles details.

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA32 Example Java Applet Window with two items Text area Button Change text when button clicked

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA33 Illustration of Applet Display Initial After user clicks button

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA34 Example Applet Code

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA35 Applet Invocation Available in HTML Uses applet tag Specifies Codebase (machine and path) Code (specific class to run) Example

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA36 Java Functionality HTML interface Controls display Interacts with user HTTP interface Accesses remote Web documents Invokes other applets Exceptions Indicate unanticipated circumstances Can be caught and handled

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA37 Example Applet Code

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA38 Example Applet Code (continued)

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA39 Illustration of Applet Display

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA40 JavaScript Technology Alternative to Java technology Provides scripting language Browser reads and interprets script in source form JavaScript can be integrated with HTML

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA41 JavaScript Example

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA42 JavaScript Example

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA43 Summary Web is major application in Internet Client Called browser Fetches and displays document Web documents Stored on servers Standard representation is HTML

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA44 Summary (continued) HTML Markup language Uses tags embedded in text URL components Protocol Domain name of server Protocol port number Path of item Only domain is required

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA45 Summary (continued) Static web page Unchanging Dynamic web page Output from a program on the server Active web page Runs in browser Consists of a computer program

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA46 Summary (continued) Dynamic web page technology Known as CGI CGI program usually a script Document begins with header line URL can contain arguments

FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA47 Summary (continued) Active web page technology Known as Java Programming language plus runtime support Document called applet