Web technologies and programming cse4461 - hypermedia and multimedia technology Fanis Tsandilas April 3, 2007.

Slides:



Advertisements
Similar presentations
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Advertisements

Objectives Ch. D - 1 At the end of this chapter students will: Know the general architecture and purpose of servlets Understand how to create a basic servlet.
CSE 190: Internet E-Commerce Lecture 7. HTML Templates Designed to separate server side logic from HTML presentation Key features –Escapes from HTML into.
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
16-Jun-15 HTTP Hypertext Transfer Protocol. 2 HTTP messages HTTP is the language that web clients and web servers use to talk to each other HTTP is largely.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
How the web works: HTTP and CGI explained
Servlets and JSP Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
Definitions, Definitions, Definitions Lead to Understanding.
Web programming for project students Dr Jim Briggs.
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.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
CSC 2720 Building Web Applications Servlet – Getting and Setting HTTP Headers.
 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.
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.
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Robinson_CIS285Winter2005 Servlets CIS January 2005 Mary Robinson.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
What are Web Services? Definition of web service A web service is a distributed unit of business logic that can be accessed over Internet standard web.
COMP3016 Web Technologies Introduction and Discussion What is the Web?
Web Technologies Computer Security Lecture 9 Tom Chothia.
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
1 Lecture #7-8 HTTP – HyperText Transfer Protocol HAIT Summer 2005 Shimrit Tzur-David.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Application Layer 2 Figures from Kurose and Ross
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
IT Engineering Instructor: Rezvan Shiravi
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
World Wide Web (WWW) A Distributed Document- Based System Group E Ricky Tong (D-A0-1611) Eddy Leong (D-A0-1623) Dick Lei (D-A0-1658)
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
A Little Bit About Cookies Fort Collins, CO Copyright © XTR Systems, LLC A Little Bit About Cookies Instructor: Joseph DiVerdi, Ph.D., M.B.A.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
S ERVLETS Cookies Handling 5-Dec-15. S ERVLETS - C OOKIES H ANDLING Cookies are text files stored on the client computer and they are kept for various.
Copyright © 2002 ProsoftTraining. All rights reserved. Java Servlets.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
HTTP How the Internet servers and clients communicate.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JavaScript, Part 4 Instructor: Charles Moen CSCI/CINF 4230.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Summer 2007 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 1 – Introducing Ajax.
5 th ed: Chapter 17 4 th ed: Chapter 21
Overview of Servlets and JSP
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
PHP Security Ryan Dunn Jason Pack. Outline PHP Overview PHP Overview Common Security Issues Common Security Issues Advanced Security Issues Advanced Security.
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Introduction to Servlets
Building Web Apps with Servlets
WEB API.
CS320 Web and Internet Programming Cookies and Session Tracking
CS3220 Web and Internet Programming Cookies and Session Tracking
CS3220 Web and Internet Programming Cookies and Session Tracking
Presentation transcript:

web technologies and programming cse hypermedia and multimedia technology Fanis Tsandilas April 3, 2007

2 the HyperText Transfer Protocol HTTP request (TCP stream) web client - browser web server HTTP response (TCP stream) TCP port: 80

3 HTTP request  request line (GET, POST, HEAD methods) GET /path/to/file/index.html HTTP/1.0  header lines (info about request, user, etc.) User-Agent: Mozilla 4.0 (X; I; Linux i586) Host: Accept: text/html image/gif, image/jpeg Authorization: user fanis:mypassword  request body (content of a form, etc.)

4 GET request  GET /cse4461/index.php?title=Main_Page HTTP/1.1  Accept: image/gif, image/x-xbitmap, image/jpeg,*/*  Accept-Language: en-us  Accept-Encoding: gzip, deflate  User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)  Host:  Connection: Keep-Alive

5 GET request  GET /cse4461/index.php?title=Main_Page HTTP/1.1  Accept: image/gif, image/x-xbitmap, image/jpeg,*/*  Accept-Language: en-us  Accept-Encoding: gzip, deflate  User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)  Host:  Connection: Keep-Alive passing parameters

6 GET request  GET /cse4461/index.php?title=Main_Page HTTP/1.1  Accept: image/gif, image/x-xbitmap, image/jpeg,*/*  Accept-Language: en-us  Accept-Encoding: gzip, deflate  User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)  Host:  Connection: Keep-Alive can keep TCP connection open to perform multiple requests (supported by newer browsers)

7 forms and post requests Country: City:

8 forms and post requests  POST /search.cgi HTTP/1.0  Host:  User-Agent: HTTPTool/1.0  Content-Type: application/x-www-form-urlencoded  Content-Length: 26  country=Canada&city=Toronto+Ontario Country: City:

9 HTTP response  HTTP/ OK  Date: Mon, 06 Dec :54:26 GMT  Server: Apache/1.3.6 (Unix)  Last-Modified: Fri, 04 Oct :06:11 GMT  Content-language: en  Connection: close  Content-type: text/html  Content-length: 1012   … 

10 HTTP response status code header response body  HTTP/ OK  Date: Mon, 06 Dec :54:26 GMT  Server: Apache/1.3.6 (Unix)  Last-Modified: Fri, 04 Oct :06:11 GMT  Content-language: en  Connection: close  Content-type: text/html  Content-length: 1012   … 

11 status codes  200 OK  301 Moved Permanently 400 Bad Request  401 Unauthorized  403 Forbidden  404 Not Found  500 Internal Server Error  …

12 authorization types: HTTP Basic, HTTP Digest GET /private/index.html HTTP/1.0 Host: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== authorization key

13 limitations of HTTP  no build-in security mechanisms  stateless - no support for session management

14 session management  techniques  URL rewriting  hidden form fields  cookies  SSL sessions client server

15 cookies  extension of HTTP - servers can store data on the client  limited size, number  client may disable them GET /index.html HTTP/1.1 Host: HTTP/ OK Content-type: text/html Set-Cookie: name=value (content of page) GET /pictures.html Host: Cookie: name=value Accept: */* clientserver

16 cookie attributes Set-Cookie: name=value; expires=date; path=/; domain= example.org Example Set-Cookie: RMID=732423sdfs73242; expires=Fri, 31-Dec :59:59 GMT; path=/; domain= example.org

17 SSL  SSL: Secure Sockets Layer  TLS: Transport Layer Security (newer)  runs between application layer (e.g., HTTP, FTP, SMTP) and TCP  HTTP: accessed by

18 server programming  PHP  ASP (Active Server Pages)  Microsoft’s product  Servlets and JSP (JavaServer Pages)  Perl

19 Java Servlet API  Java API for server programming  main classes  HttpServlet  HttpServletRequest  HttpServletResponse  HttpSession

20 example: Java servlet  import java.io.*; import javax.servlet.*; import javax.servlet.http.*;  public class Simple extends HttpServlet {  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter();  out.println(" " + “ Parameters ” + “ ” + “ Parameter 1: ” + request.getParameter(“param1”)+“\n”; + “ Parameter 2: ” + request.getParameter(“param2”); + “ ” + “ "); } } SimpleServlet.java

21 sessions in servlets  one HttpSession object for each session  obtained by getSession in HttpServletRequest object  session state  setAttribute(“name”, value)  getAttribute(“name”)

22 JSP  servlets require Java and sophisticated programming  In JSP, web applications are active pages  HTML with snippets of code  JSP pages are translated into servlets

23 example: JSP <%! int add(String x, String y){ return Integer.parseInt(x) + Integer.parseInt(y); } %> Addition The sum of and is example.jsp

24 php  open source, mainly used for server-side scripting  example: handling a simple form This is what you submitted: Country: City: example.php

25 SOAP (Simple Object Access Protocol)  communication between remote applications through HTTP  platform/language independent  XML syntax  simple and extensible  will be developed as W3C standard

26 example: SOAP <soap:Envelope xmlns:soap=" message requesting details for product with ID =

27 example: SOAP <soap:Envelope xmlns:soap=" true message giving details for requested product

28 SOAP = XML + HTTP POST /index.html HTTP/1.1 Host: Content-Type: application/soap+xml; charset=utf-8 Content-Length: 3012 …xml syntax representing a SOAP message… HTTP/ OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: 1020 …xml syntax representing another SOAP message… client server

29 AJAX  AJAX = Asynchronous JavaScript And XML  direct communication of JavaScript with the server  through JavaScript XMLHttpRequest object (Firefox, Safari) or ActiveXObject (IE)  no need to reload a page for every request for a change

30 example: AJAX function updateFunction(){ var xmlHttp; try{ xmlHttp = new XMLHttpRequest(); } //Firefox, Opera 8.0+, Safari catch(e) { alert(“browser not supported”); return false;} // when the request has been completed the time field of // myForm will be updated by the response value xmlHttp.onreadystatechange = function(){ if(xmlHttp.readyState == 4) document.myForm.time.value = xmlHttp.responseText; } // preparing and sending the request to the server // it will be served by time.php xmlHttp.open(“GET”, “time.php”, true); xmlHttp.send(null); } …

31 conclusions 