CSE 341, S. Tanimoto Lisp CGI - 1 Lisp CGI Programming for the Web Web servers can invoke Lisp to “intelligently” create web pages on the fly. We will.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Using Perl for CGI Programming.
Advertisements

Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Exploring the UNIX File System and File Security
How the web works: HTTP and CGI explained
Definitions, Definitions, Definitions Lead to Understanding.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
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.
Servlets Compiled by Dr. Billy B. L. Lim. Servlets Servlets are Java programs which are invoked to service client requests on a Web server. Servlets extend.
Web Client/Server Communication A290/A590, Fall /09/2014.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Learning basic Unix command IT 325 operating system.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
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)
HTTP; The World Wide Web Protocol
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
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,
ES Module 5 Uniform Resource Locators, Hypertext Transfer Protocol, & Common Gateway Interface.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
Working with Cookies Managing Data in a Web Site Using JavaScript Cookies* *Check and comply with the current legislation regarding handling cookies.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
USING PERL FOR CGI PROGRAMMING
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
Chapter 8 Cookies And Security JavaScript, Third Edition.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Chapter Two Exploring the UNIX File System and File Security.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Using Perl for CGI Programming.
CGI Programming. What is it? CGI –Common Gateway Interface Standard way to pass information back to the Web Server –GET Query String –POST Standard Input.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
Sessions in PHP – Page 1 of 13CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Sessions in PHP Reading: Williams.
Web Technologies Interactive Responsiveness Function Hypertext Web E-Publishing Simple Response Web Fill-in Forms Object Web « Full-Blown » Client/Server.
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.
HTML, Third Edition--Illustrated Brief 1 HTML, Third Edition Illustrated Brief Unit A Creating an HTML Document.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
File Transfer Protocol (FTP)
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
 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.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
EE 122: Lecture 21 (HyperText Transfer Protocol - HTTP) Ion Stoica Nov 20, 2001 (*)
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
National College of Science & Information Technology.
The Common Gateway Interface (CGI) Pat Morin COMP2405.
The need for persistence Consider these examples  Counting the number of “hits” on a website  i.e. how many times does a client load your web page source.
Web Development Web Servers.
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Hypertext Transport Protocol
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
Exploring the UNIX File System and File Security
Web Programming Essentials:
Presentation transcript:

CSE 341, S. Tanimoto Lisp CGI - 1 Lisp CGI Programming for the Web Web servers can invoke Lisp to “intelligently” create web pages on the fly. We will use the host cubist.cs.washington.edu to explore this form of programming.

CSE 341, S. Tanimoto Lisp CGI - 2 Common Gateway Interface CGI: A standard method whereby a web server can invoke another program to handle a query. HTTP: HyperText Transfer Protocol -- a standard for information requests and responses over the Internet.

CSE 341, S. Tanimoto Lisp CGI - 3 GET and POST GET. An HTTP request method in which parameters to a query are encoded as part of the URL and made available to a CGI program via environment variables. POST. An HTTP request method in which parameters to a query are transmitted separately and passed to the program via the standard input stream.

CSE 341, S. Tanimoto Lisp CGI - 4 A Simple CGI Program #! /usr/local/bin/gcl.exe -f (format t ”Content-type: text/html~%~%”) (format t ” Lispy ”) (format t ” Hello Web! ”) (bye) This assumes the server is a Unix host, and that the Lisp system is Gnu Common Lisp.

CSE 341, S. Tanimoto Lisp CGI - 5 (Brief Aside) Unix Commands List the contents of the directory with longer descriptions: cubist$ ls -l Descend one level in the directory hierarchy: cubist$ cd www Ascend one level in the directory hierarchy: cubist$ cd.. Rename a file: cubist$ mv test.lsp solution.lsp Move a file to a child directory: cubist$ mv solution.lsp www/

CSE 341, S. Tanimoto Lisp CGI - 6 More Unix Commands Remove (delete) a file: cubist$ rm test1.lsp Create a new subdirectory: cubist$ mkdir new-stuff Remove a subdirectory: cubist$ rmdir old-stuff Execute a Lisp program from the command line: cubist$ gcl solution.lsp cubist$./solution.lsp provided the first line of solution.lsp is... #! /usr/local/gcl -f

CSE 341, S. Tanimoto Lisp CGI - 7 More Unix Commands (cont.) chmod stands for “change mode”. Remove permissions to execute a file: cubist$ chmod -x test1.lsp Give group permission to execute: cubist$ chmod g+x test1.lsp Give read permission to all users: cubist$ chmod +r test1.lsp Take away write permission from others: cubist$ chmod o-w test1.lsp

CSE 341, S. Tanimoto Lisp CGI - 8 CGI and Sessions HTTP is “stateless” Meaningful interactions often require “sessions” Session continuity is a challenge. 3 separate mechanisms support solutions: 1. Passing session ID parameters between client and server with each transfer. 2. Using “cookies” on the client to identify a user or a session. 3. Storing a session file on the server between requests from a user.

CSE 341, S. Tanimoto Lisp CGI - 9 Other Details of CGI Programming Parameter fetching for GET and POST methods. Printing an appropriate HTTP header. Maintaining adequate levels of security: filtering user input and never executing it directly. Avoiding server time-outs.

CSE 341, S. Tanimoto Lisp CGI - 10 Code Example The KNOCK.LSP program carries on a dialog with the user over the web, telling “knock-knock” jokes. It illustrates three methods for saving session state: parameter passing, client-side cookies, and server-side session files. The code is available at: