Chapter No 01 Introduction

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Web Development With JAVA

CIT-303
Chapter # 1

Prof:Mr.Saim Saleem Goraya


We need to answer…
 …How is the Internet organised?
 …How do we find and retrieve pages on the Internet?
 …How is this data (web pages, etc) transmitted over the Internet?
 …How is what we see in the browser window defined as a collection of
data?

2
Prof:Mr.Saim Goraya
Clients and Servers
 The Web is a client/server application: Web browsers are clients which send
requests to Web servers, which send responses back.

Prof:Mr.Saim Goraya 3
Fetching Pages over the
Internet
 Architecturally, the Internet consists of a collection of layers, each one
providing services for the one above it:
 The Internet Layer gets packets to their destinations;
 The Transport Layer sends streams of data;
 The Application Layer provides high-level services to applications such as Web
browsers.

Prof:Mr.Saim Goraya 4
HTTP

 HTTP makes use of TCP to open connections between


clients and servers and to pass the requests and responses
between them.
 When a user clicks a link or types a web address:
1. A TCP connection is opened between browser and server
2. Then requests and responses are sent back and forth using
HTTP
 HTTP is a stateless protocol, meaning each request for
data is dealt with in isolation; once the server sends the
response, it forgets everything about the original request.

Prof:Mr.Saim Goraya 5
Uniform Resource Locators
(URLs)
 Without a universal addressing mechanism, it would be
impossible to navigate to a site, and page linking would
not be feasible
 Uniform Resource Locators (URLs) are used to identify
Web pages — basically a URL is a web address
 URLs have 3 components:
 A Prefix (usually http:// )
 A Hostname: (such as www.cityu.edu.hk)
 A Path: (such as /scm/index.htm)

Prof:Mr.Saim Goraya 6
Uniform Resource Locators
(URLs)
 Example:
 http://www.cityu.edu.hk/scm/index.htm

Path
Identifies a file within a
hierarchical directory
Host name
structure on the server
Identifies a particular
computer somewhere on
Prefix the Internet

The transfer protocol


required to request data
from the server
Prof:Mr.Saim Goraya 7
Uniform Resource Locators
(URLs)
 Example:
 http://www.cityu.edu.hk/scm/index.htm

Path
Identifies a file within a
hierarchical directory
Host name
structure on the server
Identifies a particular
computer somewhere on
Prefix the Internet

The transfer protocol


required to request data
from the server
Prof:Mr.Saim Goraya 8
IP Addresses and DNS
 Every computer connected to the Internet must have a unique IP address,
no matter whether it’s a client or a server (or both)
 An IP address is just a number that identifies a host on the Internet.
Example:
 212.171.218.34 or 144.214.5.218
 The Domain Name System (DNS) is a database that matches IP addresses
to host names

Prof:Mr.Saim Goraya 9
Domain Names
 And the Domain Name System (DNS) translates host names into IP
addresses, which are then used by TCP to establish connections between
HTTP clients and servers.
 Domain names are administered in such a way that they are guaranteed to
be unique.
 Domain names are organised in a hierarchical structure….

Prof:Mr.Saim Goraya 10
Top Level Domains
Top Level
 www.Umer.edu.hk Domain (TLD)
Mostly country
 www.cityu.hk domains:
.uk, .au, .hk, etc.
 www.apple.com
Generic Top Level
Domain (gTLD)
.com
.org
.net
.biz
.info
.name
.ws
Prof:Mr.Saim Goraya (.edu, .gov, .mil restricted to US only)11 .tv
Second Level Domains

 www.cityu.edu.hk The actual name of


the organisation or
 www.cityu.hk service.
Can contain letters
 www.apple.com (a to z),
numbers (0 to 9),
dashes ( - )

Prof:Mr.Saim Goraya 12
Third Level, or Sub Domains
 www.cityu.edu.hk
Strings of characters
 sweb.cityu.edu.hk that designate
different services, or
hosts within the
 www.apple.com second level domain.

 store.apple.com E.G. “www” for the


core or main website,
“sweb” for SCM’s
 seminars.apple.com sub-network within
CityU.

Prof:Mr.Saim Goraya 13
Registering Domain Names
Registered with
 www.cityu.edu.hk the HKDNR in
Hong Kong
 www.cityu.hk www.hkdnr.hk

 www.apple.com
Registered with any
global registration
service
networksolutions.com
register.com
directNIC.com
Chinese character domain etc.
names now also available
Prof:Mr.Saim Goraya 14
Registering Domain Names
 Registering a domain name can either be done directly with a registration
service, such as HKDNR, or through a website hosting service.
 Either way, you have to pay a fee for domain registration that is separate
from any site hosting fees you may pay.
 gTLD domains (.com, .org, .net): US$12 - 15 per year
 Country domains in Hong Kong:
 .com.hk, .org.hk, .net.hk: HK$200 per year
 .hk: HK$250 per year

Prof:Mr.Saim Goraya 15
Linking Domain Names and IP
Addresses
 A domain name, once registered, needs to be associated
with a fixed IP address of a web server on the Internet.
When you register and setup a new domain name, you
need to enter details of at least 2 nameservers.
 These nameservers are special internet servers that implement a
name service protocol.
 They may be provided by a web hosting service, or a domain
registration service.
 They link a domain name to the specific IP address assigned for a
website. Examples:
Note: Most commercial hosting services provide a
 ns0.directnic.com form of virtual hosting, placing many websites on
ns1.directnic.com
Prof:Mr.Saim Goraya
a single server, so special software is used to
route domains names to assigned
16 IP address.
Domain Names… not just
websites
 Once your domain name is assigned a specific IP host you can:
• Set up and run a website (www.cityu.edu.hk)
• Set up e-mail accounts (nick.foxall@cityu.edu.hk)
• Set up file transfer capabilties (ftp.cityu.edu.hk)

Prof:Mr.Saim Goraya 17
Home Page Naming
 Web servers will automatically serve up pages file-named
 index.html
index.htm
default.htm
default.html
 …as long as ONE page by those filenames resides in the
root directory of your site.
 If you want to use a page by another name as the home
page of the site, you will have to configure the server
software to point to that page.

Prof:Mr.Saim Goraya 18
The Request/Response
Procedure
1. You enter http://server.com into your browser’s address
bar.
2. Your browser looks up the IP address for server.com.
3. Your browser issues a request to that address for the
web server’s home page.
4. The request crosses the Internet and arrives at the
server.com web server.
5. The web server, having received the request, fetches
the home page from its hard disk.

Prof:Mr.Saim Goraya 19
6. With the home page now in memory, the web server notices
that it is a file incorporating PHP scripting and passes the
page to the PHP interpreter.
7. The PHP interpreter executes the PHP code.
8. Some of the PHP contains MySQL statements, which the PHP
interpreter now passes to the MySQL database engine
9. The MySQL database returns the results of the statements
back to the PHP interpreter.
10. The PHP interpreter returns the results of the executed PHP
code, along with the results from the MySQL database, to
the web server.
11. The web server returns the page to the requesting client,
which displays it.

Prof:Mr.Saim Goraya 20
web
Tim Berners-Lee (a CERN fellow) devised a method of
navigating between them using a hyperlinking framework,
which came to be known as the Hyper Text Transfer
Protocol, or HTTP. He also created a markup language
called HTML, or Hyper Text Markup Language. To bring
these together, he wrote the first web browser and web
server.

Prof:Mr.Saim Goraya 21
static

A static web page is a web page that is delivered to the


user's web browser exactly as stored, in contrast to
dynamic web pages which are generated by a web

Prof:Mr.Saim Goraya 22
Dynamic

A dynamic web page is a web page that displays different


content each time it's viewed. For example, the page may
change with the time.

Prof:Mr.Saim Goraya 23
What is Internet?

Internet is a global collection of networks which links many different


types of computers and other devices all over the world.
Some Services are Provided by Internet
 Email
 FTP
 Telnet
 UseNet news
 World Wide Web (WWW)
World Wide Web

 Commonly Known as “WWW” also Called as “Web”


 Way of exchanging information
 A ducoment on the web is called a Web Page, identified by a
unique address called “URL” and accessed by “HTTP”
What is Protocol?
“The protocol specifies how information is transferred from a link”
There are various types of protocols such as
 TCP/IP
 SMTP
 FTP
 HTTP/HTTPs
.
What is HTTP?

 HTTP stands for Hypertext Transfer Protocol.


 HTTP used for communication between the web server and web
browser.
 A standard web address such as Yahoo.com is called a URL and
here the prefix http indicates its protocol
What is Web Browser?

“Web Browsers are software installed on your PC The


Web browser is actually called a Web client(Web-Agent).
To access the Web you need a web browsers, such as
Chrome, Microsoft Internet Explorer or Mozilla Firefox”
What is Web Server?
 A computer that hosts websites.
 Run web server Software (Apache HTTP,Microsoft IIS, etc)
 This Computer is always connected to internet otherwise it will not be
able to serve the Web client.
What is Website?

Website is a set of related web pages and related content


located under a single domain name.
Two types of website:
1)Static Website
2) Dynamic Website
Web Application

A web application (or web app) is application software that runs on a Web server,
unlike computer-based software programs that are stored locally on the Operating
System of the device. Web applications are accessed by the user through a web
browser with an active internet connection.

OR
A Web Application or (Web app) is an application program that is stored on a
remote server and deliver over the internet through a browser interface.
Examples:
Web mail, online calculator, online shops etc
How Web Applications work?

.
 For a web app to operate, it needs a Web server, application
server and a database.
Client and Server side language
Web applications typically have short development cycles and
can be made with small development teams.Most Web apps are
written in JavaScript,Html% or CSS
Client-Side Programming
Client-side programming typically ultilizes these languages,which help build an
applications fornt-end such HTML,JavaScript,CSS
Server-Side Programming

Server-side programming is done to create the scripts a web app


will use.
Language such as Python,Java,PHP ,Asp.net and Ruby are
commonly used in server-side programming

You might also like