Ali Kamandi Spring 2007 kamandi@sharif.edu Sharif University of Technology
� HyperText Transfer Protocol Web Server Client Request Response � Open a connection � Make a request � Server responds Listening via a port (80) � Close connection 2 Internet Engineering-Sharif University of Technology
� Stateless ◦ If you view 10 web page, your browser makes 10 independent HTTP request ◦ Restart web server? � Anonymous 3 Internet Engineering-Sharif University of Technology
� User types www.yahoo.com into browser � Browser translates www.yahoo.com into an IP address and tries to open a TCP connection with port 80 of that address � Browser sends the following byte stream: ◦ Get / HTTP/1.0 � Yahoo responds with a set of headers indicating ◦ Which protocol is actually being used ◦ Whether or not the file requested was found ◦ How many bytes are contained in that file ◦ Kind of information (MIME: Multipurpose Internet Mail Extensions) 4 Internet Engineering-Sharif University of Technology
� Yahoo’s server sends a blank line to indicate the end of the headers � Yahoo sends the contents of its index root � The TCP connection is closed 5 Internet Engineering-Sharif University of Technology
6 Internet Engineering-Sharif University of Technology
� When the connection is over, it is over � Shopping at an e-commerce site (Amazon) ? � Engineering Challenge: Creating a stateful application on top of a fundamentally stateless protocol 7 Internet Engineering-Sharif University of Technology
� Log file on the web server? ◦ HTTP is anonymous ◦ The server only knows IP address of client ◦ Proxy? � Rewriting hyperlinks ◦ Sending extra information back to the server ◦ http://www.amazon.com/exec/obidos/ASIN/1588750019 ◦ http://www.amazon.com/exec/obidos/ASIN/1588750019/103-9609966-7089404 ◦ All the hyperlinks contain, at the end, this same session ID. ◦ HTTP does not place a priori limit on the length of a URI � 255 byte limit, error 414: request-URI Too Long 8 Internet Engineering-Sharif University of Technology
� Write some information out to an individual user that will be returned on that user’s next request � Server side connections can use it to both store and retrieve information on the client side. � Distributed database management system 9 Internet Engineering-Sharif University of Technology
� Limit: 20 cookies, max 4 kb � Cookie information will be passed back up to server on every page load. ◦ Overhead: suppose 80 kb for 20 cookies + dialup connection � They aren’t portable for the user � Security (privacy problem): some users have disabled them ◦ Using unique identifier for the data rather than the data 10 Internet Engineering-Sharif University of Technology
11 Internet Engineering-Sharif University of Technology
� DBMS � ACID test: ◦ Atomicity: all committed or all rolled back ◦ Consistency: DB is transformed from one valid state to another valid state. ◦ Isolation: the result of a transaction are invisible to other transactions until the transaction is complete. ◦ Durability: once committed, the result are permanent. 12 Internet Engineering-Sharif University of Technology
� Declarative query language (SQL) � Isolation of important data from programmers mistakes � Good performance with many thousands of simultaneous users ◦ IBM DB2 ◦ Oracle ◦ Microsoft SQL server ◦ Open-source PostgreSQL 13 Internet Engineering-Sharif University of Technology
� Develop a data model � Develop a collection of legal transactions: insert, update � Design the page flow ◦ How user interact with the system? � Implement the individual pages ◦ HTML ◦ ASP (Active Server Page) ◦ Java Server Page ◦ Servlet ◦ … 14 Internet Engineering-Sharif University of Technology
� Hyper Text Markup Language � An HTML document is just a text document with some special directives, called tags, that a web browser understands. � Tags are those things in “angle-brackets”, like <HTML>, <HEAD>, etc. � HTML has no variables or commands. � HTML is merely a way of formatting a document. � Intended to be platform- and device-independent 15 Internet Engineering-Sharif University of Technology
� Text with links to other documents � What’s the big deal? ◦ Links didn’t exist until the 1960’s and were novel well into the 1980’s ◦ Hypertext only existed on single computers or local area networks until about 1990 16 Internet Engineering-Sharif University of Technology
� Markup languages have special elements that mark formatting or semantics � HTML An <emph>important</emph> concept � LaTeX An {\em important}concept 17 Internet Engineering-Sharif University of Technology
� Nothing Special � Text Editors � FrontPage 18 Internet Engineering-Sharif University of Technology
� Formatting is accomplished through the use of ‘tags’. <tag> � Many tags have a ‘begin’ tag and an ‘end’ tag. <TAG> Object the tag effects </TAG> � Examples: ◦ <html> … </html> <b> … </b> <p> <br> <a> … </a> <table> … </table> <font> … </font> 19 Internet Engineering-Sharif University of Technology
� Some tags have key=value pairs known as attributes. These describe or modify what the tag is doing. � Examples: ◦ <a href=http://www.rpi.edu> … </a> ◦ <font color= “ blue ” > … </font> ◦ <tr align= “ center ” > … </tr> 20 Internet Engineering-Sharif University of Technology
� Every page will contain the following: <HTML> <HEAD> <TITLE>My web page</TITLE> </HEAD> <BODY> Welcome to my web page! </BODY> </HTML> 21 Internet Engineering-Sharif University of Technology
� Contains info about the document. Most common/important: title <head> <title>My HTML Document</title> </head> � “My HTML Document” will appear in title bar of Netscape, IE, Opera, etc… 22 Internet Engineering-Sharif University of Technology
� Contains all text displayed in the web browser window. � <br> - line break � <p> - paragraph break (equivalent to 2 <br>s) � Appearance <B> makes text bold � <center>…</center> Center-align all contained text 23 Internet Engineering-Sharif University of Technology
� <b> text to be rendered bold </b> � <B> text to be rendered bold </B> � <b> This would be displayed in the same way as the other two </b> � <i> text to be rendered in italics </i>
<FONT SIZE=24 COLOR="CC3300" FACE=“Zar"> 25 Internet Engineering-Sharif University of Technology
<html> <head> <title>HTML Basics</title> </head> <body> <p> </p> </body> </html> 26 Internet Engineering-Sharif University of Technology
Heading 1 -- <H1> Heading 1 </H1> Heading 2 -- <H2> Heading 2 </H2> Heading 3 -- <H3> Heading 3 </H3> Heading 4 -- <H4> Heading 4 </H4> Heading 5 -- <H5> Heading 5 </H5> Heading 6 -- <h6> Heading 6 </H6> 27 Internet Engineering-Sharif University of Technology
� <!-- your comment --> � Comments can be many lines long. 28 Internet Engineering-Sharif University of Technology
<img src=“ name_of_image.gif ” / > <img src=“ images/image_name.gif ” / > Example: <IMG SRC="image.gif" BORDER=0> BORDER=0 BORDER=2 BORDER=5 29 Internet Engineering-Sharif University of Technology
You should create a graphic link for users with slow modems or text-only web access by using the <ALT> option. Example: <img src=“pencil.gif" ALT=pencil graphic> pencil graphic 30 Internet Engineering-Sharif University of Technology
� <a href=“URL”>Text to be used for the link</a> � Example: <A HREF="http://www.google.com">Google Search</A> | | | | Opening File to load when User can click on Closing Tag link is selected this text to pull Tag up the file
<p>Relative File Path Link <a href=“.. /page2.html ”>Web Week</a> </p> 32 Internet Engineering-Sharif University of Technology
<a href=“URL”> <img src=“image.gif” /> </a> 33 Internet Engineering-Sharif University of Technology
� <table> … </table> ◦ contains entire table � <tr> … </tr> ◦ contains one row of a table � <td> … </td> ◦ contains one cell of a table � <th> … </th> ◦ contains a table column heading (this tag is optional in the sense that columns do not require column headings) 34 Internet Engineering-Sharif University of Technology
Recommend
More recommend