Lecture 32 - KFUPM Open Courseware
Download
Report
Transcript Lecture 32 - KFUPM Open Courseware
Software Testing and Quality
Assurance
Lecture 32 –
SWE 205
Course Objective:
Basics of Programming Languages &
Software Construction Techniques
1
Lecture Outline
Web Applications and Web Servers
Introduction to HTTP
Introduction to HTML
2
Role of HTTP
Web applications are different than
traditional desktop applications.
A production level web application will
always involve at least two networked
machines.
The machines must agree upon a
particular protocol to determine
How to send and receive data.
Hypertext Transfer Protocol (HTTP)
3
Role of HTTP
A client launches a web browser
An HTTP request is made to access a
particular resource (e.g. *.aspx file or .html
file) located on a server machine.
HTTP is a text-based protocol
Build on request/response.
4
Role of HTTP
If we navigate (www.kfupm.edu.sa)
The browser software access Domain
Name System (DNS), which converts the
registered URL into IP address.
Browser opens a socket connection
(typically port 80), and sends the HTTP
request to the default page at the KFUPM
website.
5
Role of HTTP
Hosting web server receives the
incoming HTTP request,
May use client supplied input to format a
proper HTTP response.
Web programmers can use any technology
(e.g. ASP.NET,JSP) to dynamically
generate content.
Finally, client renders the HTML
received from the web server.
6
Role of HTTP
Client – side Browser
Display HTML
obtained from
HTTP response
Incoming
HTTP request
Web Server
Web Application (any
number of Server – side
resources such as
*.asp, html files)
Outgoing
HTTP Response
7
Web Applications and Web
Servers
Web Applications
A collection of files (*.html, *.asp, etc.) and related
components (.NET)
Stored within a particular directory on a given web
server.
Web Server
Software product in charge of hosting your web
applications; and typically
Provides a number of related services security etc.
8
Internet Information Server (IIS)
ASP.NET web applications interacts
with IIS.
IIS can host numerous web
applications, each of which resides in a
virtual directory.
Each virtual directory is mapped to a
physical directory on the local hard disk.
9
Internet Information Server (IIS)
For example, we create a virtual
directroy ‘CarsAreUs’
Naviagte using www.carsAreUs.com.sa
The virtual directory maps to a physical
directory such as
C:\TheCarsSite, which contains set of files that
constitute the web application.
Creating ASP.NET web applications using Visual Studio,
automatically creates a new virtual directory for the project.
10
Role of HTML
Hypertext Markup Language (HTML) is used
to describe how
Text, images, external links etc are rendered by
the client-side browser.
A HTML file consists of a set of tags that
describe the look and feel of a web page. For
example,
*.html file open and close with <html> and </html>
tags; typically followed by
<body> section, …….
HTML is not case sensitive
11
HTML - Example
<html>
<head>
<title> This is a Car Web Site </title>
</head>
<body>
</body>
</html>
12
HTML - Example
<html>
<head>
<title> This is Cars web site</title>
</head>
<body BGCOLOR = “#66ccff”>
<!– Prompt for use input -->
<h1 align = “center”>The cars login page</h1>
<p align = “center”>
<br> Please enter your <i> user name</i> and <i> password</i>.</p>
<!– Build a form to get user info -->
<form name = “MainForm” ID = “Form1”>
</form>
</body>
</html>
13
HTML - Example
<form name = “MainForm” ID =“MainForm”>
<p align=“center”>User Name:
<input id=“txtUserName” type=“text” Name=“txtUserName”></p>
<p align=“center”>Password:
<input name=“txtpassword” type=“password”
ID=“txtPassword”></p>
<p align=“center”>
<input name=“btnSubmit” type=“submit” value=“Submit”
ID=“btnSubmit”>
<input name=“btnReset” type=“reset” value=“Reset”
ID=“btnReset”>
</P>
</form>
14
Key Points
Web Applications are different than
traditional desktop applications.
HTTP is build on request/response text
based protocol.
HTML is used to describe how text,
images etc. are rendered by a web
browser.
15