1 / 25

Chapter 3 Web Software

Chapter 3 Web Software. Objectives. Name the four primary components of a web-based application Describe the responsibilities of a web browser Explain cache control and cookie management details Describe the responsibilities of a web server

moesha
Download Presentation

Chapter 3 Web Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3Web Software

  2. Objectives • Name the four primary components of a web-based application • Describe the responsibilities of a web browser • Explain cache control and cookie management details • Describe the responsibilities of a web server • Explain the different web development application environments • Describe the purpose of an RDBMS • Name the protocols supported by a modern RDBMS

  3. Web Application Components • Four important components of a web application: Business Application Web Browser Web Server Database Server Client-Side Server-Side

  4. Web Application Components • Web Browser: presents the user interface • Web Server: processes HTTP requests • Business Application: processes requests at the application level by providing a service • Database Server: maintains the database by processing query and update requests from the application

  5. Web BrowsersTime-Line of Widely Used Browsers

  6. Web Browser Responsibilities • User Interface Presentation • Client-Server Communication (HTTP) • Cache Control • Cookie Management • Handling Embedded Objects • Script Interpretation

  7. User Interface Presentation • Parse HTML and CSS code • handle errors • Format and present a graphical display • Handle user interactions • scroll, mouse movement, click, etc.

  8. Client-Server Communication (HTTP) • Format HTTP request • Handle HTTP response • including redirects, errors, etc. • Request subordinate items • images, style sheets, etc.

  9. Cache Control • Cache is a local memory for recently accessed web pages, images, etc. • Cache enables pages to be reloaded quickly, without another HTTP transaction Cache reload Server Browser initial request

  10. Cache Control HTTP Headers • Cache-Control: <option> (response header) • public – client or proxy server may cache • private – only the client may cache • no-cache – no caching anywhere • If-Modified-Since: <date> (request header) • tells server to send resource only if modified since the specified date • otherwise the client will use a cached version

  11. Cache Control HTTP Headers • HTTP response with Cache-Control header HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Last-Modified: Thu, 22 Sep 2005 12:57:30 GMT Cache-Control: private Expires: Wed, 26 Sep 2007 14:15:51 GMT Content-Type: text/html Content-Length: 327 Date: Tue, 25 Sep 2007 14:15:51 GMT • HTTP transaction with If-Modified-Since header GET /index.html HTTP/1.1 Host: grove.cs.jmu.edu If-Modified-Since: Tue, 25 Sep 2007 14:15:51 GMT Date: Tue, 25 Sep 2007 14:15:51 GMT HTTP/1.1 304 Not Modified Date: Tue, 25 Sep 2007 14:35:36 GMT Server: Apache/2.2.3 (Red Hat) request response

  12. Cookie Management • An HTTP cookie is a small file that is • provided by the server as an HTTP response header • stored by the client • returned to the server as an HTTP request header Server Client Cookie contents Cookie Storage

  13. Cookies and Sessions • HTTP Session: a series of HTTP transactions between a client and a server • Cookies allow servers to identify sessions • Typical usage • initial transaction: server creates session (server-side) and stores session-id in a cookie (client-side) • subsequent transactions: client sends session-id with each request, allowing server to locate session data

  14. Cookies and Sessions Server Client Make 1st request Create session Handle response Session data * Cookie (session-id) Make 2nd request * Continue session Handle response * includes session-id

  15. Cookie Parameters • Cookie parameters are set in a Set-Cookie response header HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: domain=widget.com; path=/; secure; Account=766324 Content-Type: text/html Content-Length: 327 Date: Tue, 25 Sep 2007 14:15:51 GMT

  16. Cookie Parameters • expires=<date>: determines when cookie will be deleted • domain=<domain name> : cookie will be returned to each domain that ends with this value • path=<path name> : cookie will be returned only for requests that start with this path • secure : if present, cookie will be returned only with HTTPS (secure HTTP) requests • <name>=<value> : allow arbitrary data to be stored in a cookie

  17. Handling Embedded Objects • Objects referenced by an HTML document (images, scripts, style sheets, etc.) must be loaded separately by the browser • A plug-in or helper application may be used • Helper application: a program that handles content in a separate window • e.g., audio player, movie player • Plug-in: a program that handles content within the browser • e.g., animation viewer or virtual machine for applets

  18. Script Interpretation • Most browsers interpret JavaScript and its variants (ECMAScript, JScript, etc.) • Scripting languages are powerful, so interpreters are necessarily complex • Script interpreters are not entirely standardized across browsers, so script programmers must test scripts on many browser versions • The “write once, test many” principle in action

  19. Web Server Responsibilities • Connection Management • HTTP request handling

  20. Connection Management • With HTTP/1.1, servers are responsible for setting up and tearing down TCP connections over a series of requests • improves efficiency

  21. HTTP Request Handling • Servers must correctly interpret HTTP request headers and respond appropriately • Static content includes fixed files that are returned without any further computation • Dynamic content is generated on request by an application component that is invoked by the server

  22. Application Development Environments (1/2) • Common Gateway Interface (CGI) • allows programs to be invoked at the operating system level • Servlet Container • allows programs written in Java to be invoked in a Java Virtual Machine linked to the server

  23. Application Development Environments (2/2) • Template Language • allows executable code to be inserted into an HTML document • Scripting Language • a language that can be used to generate HTML content on request • typically have relaxed syntax, requiring less coding than regular programming languages

  24. Database Server Responsibilities • Relational Database Management System (RDBMS) • Maintains data storage for an application • processes queries and updates • Provides a standard interface for application programs • Open DataBase Connectivity (ODBC) • Java DataBase Connectivity (JDBC) • Supports standard query language for data query and manipulation • Structured Query Language (SQL)

  25. Review • Web application components • Web browsers • Web servers • Application development environments • Database servers

More Related