The document provides an introduction to basic web architecture, including HTML, URIs, HTTP, cookies, database-driven websites, AJAX, web services, XML, and JSON. It discusses how the web is a two-tiered architecture with a web browser displaying information from a web server. Key components like HTTP requests and responses are outlined. Extension of web architecture with server-side processing using languages like PHP and client-side processing with JavaScript are also summarized.
The World WideWebIn 1989, Tim Berners-Lee had suggested a way to let all users, but particularly scientists, browse each others’ papers on the Internet.He developed HTML, URLs, and HTTP.
Basic Web ArchitectureTheweb is a two-tiered architecture.A web browser displays information content, and a web server that transfers information to the client.
8.
Web BrowserThe primarypurpose is to bring information resources to the user. An application for retrieving, presenting, and traversing information resources.
9.
Web ServerThe termweb server or webserver can mean one of two things:A computer program that accepts HTTP requests and return HTTP responses with optional data content. A computer that runs a computer program as described above.
URIURLs are locationdependent It contains four distinct parts: the protocol type, the machine name, the directory path and the file name. There are several kinds of URLs: file URLs, FTP URLs, and HTTP URLs.
HTTPHTTP is arequest/response standard of a client and a server.Typically, an HTTP client initiates a request.Resources to be accessed by HTTP are identified using Uniform Resource Identifiers (URIs).
16.
Request messageThe requestmessage consists of the following:Request lineHeaders (Accept-Language, Accept, ….)An empty lineAn optional message body
17.
Request methodsHTTP defineseight methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource.HEADGETPOSTPUTDELETETRACEOPTIONSCONNECT
18.
Safe methodsHEAD, GET,OPTIONS and TRACE are defined as safe (no side effects).POST, PUT and DELETE are intended for actions which may cause side effects either on the server.
Web Architecture ExtensionCGIextends the architecture to three-tiers by adding a back-end server that provides services to the Web server.
34.
Traditional uses ofJavaScriptJavaScript is a scripting language designed for creating dynamic, interactive Web applications that link together objects and resources on both clients and servers.Getting your Web page to respond or react directly to user interaction with form elements and hypertext linksPreprocessing data on the client before submission to a serverChanging content and styles
Cookie ExpirationCookies expire,and are therefore not sent by the browser to the server, under any of these conditions:At the end of the user session if the cookie is not persistent An expiration date has been specified, and has passed The expiration date of the cookie is changed to a date in the past The browser deletes the cookie by user request
Server-side processingIn server-sideprocessing, the Web server:Receives the dynamic Web page requestPerforms all of the processing necessary to create the dynamic Web pageSends the finished Web page to the client for display in the client’s browser
46.
Client-side processingClient-side processingSomeprocessing needs to be “executed” by the browser, either to form the request for the dynamic Web page or to create or display the dynamic Web page.Eg. Javascript code to validate user input
47.
Server and Clientside processingServer-side processingPHPASPASP.NETPerlJ2EEPython, e.g. DjangoRuby, e.g. Ruby on RailsColdFusionClient-side processingCSSHTMLJavaScriptAdobe FlexMicrosoft Silverlight
Defining AjaxAjax isn’ta technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:XHTML and CSS;Document Object Model; XML and XSLT; XMLHttpRequest; JavaScriptJesse James Garrett, essay infebruary 18, 2005 Ajax: A New Approach to Web Applications
52.
Drawbacks of AJAXItbreaks browser history engine (Back button).No bookmark.The same origin policy.Ajax opens up another attack vector for malicious code that web developers might not fully test for.
Web ServicesWeb Serviceis a software system designed to support machine-to-machine interaction over a network. Web services are frequently just Internet Application Programming Interfaces (API) that can be accessed over a network.
55.
Web Services (cont.)WebServices are platform-independent and language-independent, since they use standard XML languages.Most Web Services use HTTP for transmitting messages (such as the service request and response).Style of UseRPCSOAPREST
Attributes help youto give more meaning and describe your element more efficiently and clearly.XML (cont.)<?xml version=\"1.0\" encoding=\"UTF-8\"?><person> <id type="integer">1111</id> <last_name>Smith</last_name> <first_name>John</first_name> <address> <city>New York</city> <street>21 2nd Street</street> <postal_code type="integer">10021</postal_code> <state>NY</state> </address></person>
It serves asan alternative to the use of the XML format.Douglas Crockford is a seniorJavaScript Architect at Yahoo!He is well known for his work in introducing JavaScript Object Notation (JSON).