Overview of Servlets and JSP

Slides:



Advertisements
Similar presentations
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Advertisements

HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
HyperText Transfer Protocol (HTTP)
HTTP – HyperText Transfer Protocol
HTTP By: Becky Fultz, Joe Flager, Katie Huston, Tom Packard, Allison Wilsey.
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
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
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Web, HTTP and Web Caching
Definitions, Definitions, Definitions Lead to Understanding.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
 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.
PL-IV- Group A HTTP Request & Response Header
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
Introduction to Web Programming Fall 2014/2015 Some slides are based upon Web Technologies course slides, HUJI, 2009 Extended System Programming Laboratory.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
COMP3016 Web Technologies Introduction and Discussion What is the Web?
HTTP Protocol Specification
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.
Mail (smtp), VoIP (sip, rtp)
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
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.
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Application Layer 2 Figures from Kurose and Ross
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Week 11: Application Layer1 Web and HTTP First some jargon r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,…
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
2: Application Layer1 Web and HTTP First some jargon Web page consists of base HTML-file which includes several referenced objects Object can be HTML file,
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
IT Engineering Instructor: Rezvan Shiravi
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
CS320 Web and Internet Programming Handling HTTP Requests Chengyu Sun California State University, Los Angeles.
Proxy Lab Recitation I Monday Nov 20, 2006.
HyperText Transfer Protocol (HTTP) RICHI GUPTA CISC 856: TCP/IP and Upper Layer Protocols Fall 2007 Thanks to Dr. Amer, UDEL for some of the slides used.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
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)
Advance Computer Networks Lecture#05 Instructor: Engr. Muhammad Mateen Yaqoob.
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.
Overview of RESTful Web Services “A complex system that works is invariably found to have evolved from a simple system that worked.” – John Gall (Systemantics)
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):
Week 11: Application Layer 1 Web and HTTP r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists.
Web Protocols: HTTP COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
What’s Really Happening
Hypertext Transfer Protocol (HTTP) COMP6218 Web Architecture Dr Nicholas Gibbins –
Tiny http client and server
Block 5: An application layer protocol: HTTP
How HTTP Works Made by Manish Kushwaha.
HTTP – An overview.
HTTP Protocol Specification
HTTP Hypertext Transfer Protocol
CSCI-351 Data communication and Networks
Presentation transcript:

Overview of Servlets and JSP Overview of HTTP ©SoftMoore Consulting

Overview of Servlets and JSP HTTP Hypertext Transfer Protocol Specification: http://www.w3.org/Protocols/rfc2616/rfc2616.html Set of rules for transferring resources (files, images, etc.) over the web A resource on the web is usually identified by a URL (Uniform Resource Locator) Characteristics simple stateless text-based (originally, but not HTTP/2) request/response protocol ©SoftMoore Consulting

Structure of an HTTP Transaction Overview of Servlets and JSP Structure of an HTTP Transaction HTTP client (e.g., a browser) opens a connection and sends a request message to an HTTP server. Server formulates and returns a response message, usually containing the resource that was requested. In HTTP/1.0, after delivering the response, the server closed the connection. Connection information was not maintained between transactions. HTTP/1.1 added persistent connections connection can remain open after receiving a response and can be re-used for the next request ©SoftMoore Consulting

HTTP Example Using HTTP 1.0 Overview of Servlets and JSP HTTP Example Using HTTP 1.0 From the command prompt, enter the following commands: telnet set localecho open macs.citadel.edu 80 GET /moorej/hello.html HTTP/1.0 <enter> Note: Telnet is not installed by default on Windows. To turn it on, go to Control Panel -> All Control Panel Items -> Programs and Features. Click on “Turn Windows features on or off” and check the box for Telnet Client. ©SoftMoore Consulting

HTTP Example Using HTTP 1.1 Overview of Servlets and JSP HTTP Example Using HTTP 1.1 From the command prompt, enter the following commands: telnet set localecho open macs.citadel.edu 80 GET /moorej/hello.html HTTP/1.1 Host: macs.citadel.edu <enter> With HTTP 1.1, a single web server can host several domains. Therefore, every HTTP request must specify the host name (and possibly port if different from 80). ©SoftMoore Consulting

Overview of Servlets and JSP HTTP Message Format Both request and response messages have a similar format: an initial line zero or more lines known as headers a blank line an optional message body (e.g. a file, query data, binary data, etc.) ©SoftMoore Consulting

Overview of Servlets and JSP Initial Request Line The initial line of a request has three parts, separated by spaces: Method name GET is the most common HTTP method Other methods include POST and HEAD Method names are always uppercase Local path of the requested resource the request URI (a URI is like a URL, but more general) Version of HTTP being used Always takes the form “HTTP/x.x” ©SoftMoore Consulting

Initial Response Line (a.k.a. the Status Line) Overview of Servlets and JSP Initial Response Line (a.k.a. the Status Line) The initial line of a response also has three parts, separated by spaces: The HTTP version same format as the initial request line, “HTTP/x.x” A response status code that gives the result of the request Examples: 200 or 404 An English phrase describing the status code. Examples: “OK” or “Not Found” Example: HTTP/1.0 200 OK ©SoftMoore Consulting

Overview of Servlets and JSP Status Code Three-digit integer First digit identifies the general category of response 1xx indicates an informational message only 2xx indicates success of some kind 3xx redirects the client to another URL 4xx indicates an error on the client's part 5xx indicates an error on the server's part ©SoftMoore Consulting

Overview of Servlets and JSP Common Status Codes 200 OK request succeeded; resource is returned in the message body 404 Not Found requested resource doesn’t exist 301 Moved Permanently 302 Moved Temporarily 303 See Other (HTTP 1.1 only) resource has moved to the URL given in the “Location” response header; should be automatically retrieved by the client 500 Server Error unexpected server error ©SoftMoore Consulting

Overview of Servlets and JSP HTTP Methods HTTP defines a set of request messages called methods (not to be confused with Java methods) GET POST PUT DELETE HEAD Others (CONNECT, TRACE. etc.) ©SoftMoore

Overview of Servlets and JSP The HTTP GET Method Requests information from a web server Example GET /HelloUser.jsp?name=John HTTP/1.1 Host: www.softmoore.com:80 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 Accept: text/xml,application/xml,application/xhtml+xml, text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Note: Each header is on a single line (no line breaks). ©SoftMoore

Using HTTP GET Requests Overview of Servlets and JSP Using HTTP GET Requests The handling of a GET method is expected to be safe: it does not have any side effects for which users are held responsible idempotent: it can safely be repeated. This allows a client to repeat a GET request without penalty. Intuitively, GET should be “looking without touching.” If processing has side effects, use another HTTP method, such as POST. ©SoftMoore

Important Limitation on HTTP GET Requests Overview of Servlets and JSP Important Limitation on HTTP GET Requests Most web servers limit how much data can be passed as part of the URL name (usually a few hundred bytes). If more data must be passed between the client and the server, the HTTP POST method can be used instead. data as part of the URL ©SoftMoore

Example: HTTP Response to a GET Method Overview of Servlets and JSP Example: HTTP Response to a GET Method HTTP/1.1 200 Document follows Date: Tue, 14 Apr 2007 09:25:19 PST Server: JWS/1.1 Last-modified: Mon, 17 Jun 2005 21:53:08 GMT Content-type: text/html Content-length: 4435 <4435 bytes worth of data -- the document body> ©SoftMoore

Overview of Servlets and JSP The HEAD Method Similar to the HTTP GET method Server returns only the header information. HEAD is often used to check the following: last-modified date of a document on the server for caching purposes size of a document before downloading server type type of the requested document ©SoftMoore

Overview of Servlets and JSP The POST Method Allows a client to send data to the server Passes all of its parameter data in an input stream Unlike the GET method, POST may cause side effects is not required to be repeatable Several purposes posting information to a newsgroup adding entries to a web site's guest book passing more information than a GET request allows ©SoftMoore

Overview of Servlets and JSP Example: POST Request POST /servlet/MyServlet HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Host: www.softmoore.com Accept: image/gif, image/x-xbitmap, image/jpeg, */ Content-type: application/x-www-form-urlencoded Content-length: 39 name=John&company=SoftMoore%20Consulting Note: A blank line signals the end of the POST request header and the beginning of the extended information. ©SoftMoore

HTTP/2 Second major version of the HTTP network protocol Approved in February 2015 as the successor to HTTP 1.1. which was standardized in 1997. Based on SPDY, an HTTP-compatible protocol developed by Google and supported in most browsers. ©SoftMoore Consulting

HTTP/2 Features Binary, multiplexed network protocol no longer text-based Basic protocol unit of HTTP/2 is a frame. Frames are exchanged over a TCP connection instead of text-based messages. Negotiation mechanism allows use of HTTP 1.1, 2.0, etc. Maintains high-level compatibility with HTTP 1.1 HTTP methods, status codes, default port numbers, and semantics are not changed. Loads page elements in parallel over a single TCP connection HTTP/1.1 used multiple parallel connections for downloading all the elements on a given web page (e.g., images). ©SoftMoore Consulting