Web System & Technologies Notes
Web System & Technologies Notes
Web System & Technologies Notes
A web site is more than just a group of web pages that are connected to each other through
hypertext links.
Web Application
• The user accesses a web application via a web browser by generating a request to the web
server over the Internet.
• The web server forwards the request to the web application server.
• The web application server querying the database or processing the data and generates the
results.
• The web application server sends the results back to the web server.
• The web server delivers the requested information to the client and the information
appears on the user’s display.
Web Server
A web server is a system that delivers content or services to end users over the internet. A web
server consists of a physical server, server operating system (OS) and software used to facilitate
HTTP communication.
Page | 1
TCP/IP
A layered grouping of data communications protocols. The name TCP/IP refers to two of the
most important protocols within the suite, Transmission Control Protocol (TCP) and Internet
Protocol (IP), but the suite is comprised of many other significant protocols and services.
3. Host-To-Host Layer
• The error-free delivery of data is the main function of this layer
• There are two main protocols present in this layer:
o TCP: Transmission Control Protocol is a reliable communication protocol. Its
manager the flow of data.
o UDP: It is a connection-free protocol which makes it cost-effective but less
reliable.
4. Application Layer
• Node-to-node communication based on the user-interface occurs here
• Multiple protocols are present in this layer, a few common ones have been mentioned
below in brief:
o HTTP: Hypertext Transfer Protocol is used to manage the communication
between the server and web browsers
o FTP: File Transfer Protocol, as the name suggests allows easy transferring of files
Telnet
The Telnet protocol operates within the Application layer. By telnet we can “login” to a remote
system over the Internet
Secure Shell
The Telnet protocol is now considered a poor mechanism for connecting to remote systems,
because Telnet servers and clients transmit all their data (including passwords) unencrypted.
Secure Shell (SSH) establishes connections and transfers data over secure channels, encrypting
transmitted data and promoting security.
Email
The email refers to the electronic means of communication of sending and receiving messages
over the Internet.
• The transmission of e-mail is performed through the SMTP protocol.
Page | 2
• The reading of e-mail is usually performed through either POP or IMAP.
• The mail server is responsible for sending, receiving, managing, and recording all the data
proceeded by their respective mail programs and then processing them to their
respective users.
SMTP
SMTP stands for Simple Mail Transfer Protocol, and it is responsible for sending email
messages. This protocol is used by email clients and mail servers to exchange emails between
computers.
POP3
The POP3 abbreviation stands for Post Office Protocol version 3, which provides access to an
inbox stored in an email server. It executes the download and delete operations for messages.
Thus, when a POP3 client connects to the mail server, it retrieves all messages from the
mailbox. Then it stores them on your local computer and deletes them from the remote server.
Thanks to this protocol, you can access the messages locally in offline mode as well.
IMAP
The Internet Message Access Protocol (IMAP) allows you to access and manage your email
messages on the email server. This protocol permits you to manipulate folders, permanently
delete and efficiently search through messages. It also gives you the option to set or remove
email flags or fetch email attributes selectively.
MIME
Originally, e-mail systems transmitted messages in the form of standard ASCII text. If a user
wanted to send a file (e.g., an image or sound file), it had to be encoded before it could be
placed into the body of the message. The sender had to communicate the nature of data
directly to the receiver.
Multimedia Internet Mail Extensions (MIME) provided a uniform mechanism for including
encoded attachments within a multipart e-mail message. MIME supports the definition of
boundaries separating the text portion of a message (the “body”) from its attachments.
FTP
FTP (File Transfer Protocol) is used to communicate and transfer files between computers
on the internet. Users, who have been granted access, can receive and transfer files in the
File Transfer Protocol server.
Page | 3
URL
URL stands for Uniform Resource Locator is the global address of documents and other
resources on the World Wide Web. Its main purpose is to identify the location of a document
and other resources available on the internet and specify the mechanism for accessing it
through a web browser.
HTTP
HTTP is communication protocol, that is used to deliver data on the World Wide Web. It
provides a standardized way for computers to communicate with each other.
HTTP is stateless: The server and client are aware of each other only during a current request.
Afterwards, both of them forget about each other.
Example: A client (browser) sends an HTTP request to the server; then the server returns a
response to the client. The response contains status information about the request and may also
contain the requested content.
The request from the client browser should look like below.
GET /home.html HTTP/1.1
Host: www.yoursite.com
The response from the web server should look like below:
HTTP/1.1 200 OK
Page | 4
Date: Sun, 28 Jul 2013 15:37:37 GMT
Last-Modified: Sun, 07 Jul 2013 06:13:43 GMT
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Chunked transfer encoding is a method in which the server responds with a data in chunks, and
this used in place of Content-Length header. The communication is stopped when a zero length
of chunk is received, and this method is used in HTTP Version 1.1.
HTTPS
HTTPS is the secured HTTP protocol required to send and receive information securely over
internet. Nowadays it is mandatory for all websites to have HTTPS protocol to have secured
internet.
Besides the security and encryption, the communication structure of HTTPS protocol remains
same as HTTP protocol as explained above.
SGML: Standard generalized markup language is a text markup language that serves as a
superset of all markup language.
Example
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tom</to>
<from>Jerry</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend! </body>
</note>
Page | 5
The XML above does not DO anything. XML is just information wrapped in tags.
Example: Books.xml
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
XML Tree
XML documents form a tree structure that starts at "the root" and branches to "the leaves".
Page | 6
Parsing a Text String
<html><body>
<p id="demo"></p>
<script>
var text, parser, xmlDoc;
text = "<bookstore><book>" +
"<title>Everyday Italian</title>" +
"<author>Giada De Laurentiis</author>" +
"<year>2005</year>" +
"</book></bookstore>";
document.getElementById("demo").innerHTML =
xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
</script>
</body>
</html>
<ul>
{
for $x in doc("books.xml")/bookstore/book/title
order by $x
return <li>{data($x)}</li>
}
</ul>
<ul>
<li>Everyday Italian</li>
<li>Harry Potter</li>
</ul>
Page | 7
DTD (Document Type Definition)
DTD is used to define the structure and the legal elements and attributes of an XML document.
Explanation
!DOCTYPE note – Used to define that note is the root element of the document.
!ELEMENT note – Used to define that the note element must contain the elements: “to, from,
heading, body”.
!ELEMENT to – Used to define that the “to” element is to be of type “#PCDATA”.
!ELEMENT from – Used to define that the “from” element is to be of type “#PCDATA”.
!ELEMENT heading – Used to define the heading element to be of type “#PCDATA”.
!ELEMENT body – Used to define the body element to be of type “#PCDATA”
XML Schema
• An XML Schema describes the structure of an XML document, just like a DTD.
• An XML document validated against an XML Schema is both "Well Formed" and "Valid".
• XML Schema is an XML-based alternative to DTD
XHTML MP
XHTML Mobile Profile (XHTML MP) is a simplified version of XHTML that was defined to support
wireless applications. The goal of XHTML Mobile Profile is to bring together the technologies for
mobile Internet browsing and that for the World Wide Web.
Web Services
Web services are data exchange systems that use the internet for application-to-application
communication. These processes involve programs, messages, documents, and objects.
Page | 8
happen between them. Since they are built using different development languages, it becomes
difficult to ensure accurate communication between applications.
Here is where web services come in. Web services provide a common platform that allows
multiple applications built on various programming languages to have the ability to
communicate with each other.
SOAP
• SOAP stands for Simple Object Access Protocol
• SOAP is based on XML
• SOAP is platform independent
Why SOAP?
• It is important for web application to be able to communicate over the internet.
• SOAP provides a way to communicate between applications running on different
operating systems, with different technologies and programming languages.
A SOAP Example
In the example below, a GetStockPrice request is sent to a server. The request has a StockName
parameter, and a Price parameter that will be returned in the response.
A SOAP request:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
Page | 9
REST (Representational State Transfer)
Web services that are defined on the concept of REST are RESTful web services. When a client
makes a request via RESTful API, it transfers the representation of the state of the resources to
the server. This information can be transferred in various formats via HTTP like, JSON, HTML,
XLT, and Plain Text, but JSON is the most common language used due to its easy readability by
machines and humans.
WSDL
• WSDL stands for Web Services Description Language
• WSDL file contains the location of the web service
• WSDL is used to describe a web service
o So that client applications can understand what the web service does
• WSDL is written in XML
The <types> tag is used to define all the complex datatypes, which will be used in the message
exchanged between the client application and the web service.
The <messages> tag is used to define the message which is exchanged between the client
application and the web server.
The <portType> tag is used to encapsulate every input and output message into one logical
operation.
The <binding> tag is used to bind the operation to the port type. This is so that when the client
application calls the relevant port type, it will then be able to access the operations which are
bound to this port type.
The <service> tag is a name given to the web service itself. Initially, when a client application
makes a call to the web service, it will do by calling the name of the web service. For example, a
web service can be located at an address such as http://localhost/Tutorial.asmx .
Semantic Web
The Semantic Web is the major effort on the part of the World Wide Web Consortium. It aims to
create the next generation Internet infrastructure, where information has well-defined meaning,
making it possible for people and programs to cooperate with each other. The critical part is to
associate data with meaning, and here the important role belongs to RDF and its descendants. In
Page | 10
the long term, we expect that RDF in combining with other standards such as XML, WSDL, SOAP,
and UDDI will serve as the foundation for Semantic Web applications.
• SEO is the practice of optimizing a website to increase the quantity and quality of its
traffic from a search engine’s organic results.
• In simple terms, SEO explaining to search engines that your content is the best result for
the topic at hand. This is because all search engines have the same goal: To show the best,
most relevant results to their users.
• Precisely how you do this depends on the search engine you’re optimizing for.
• If you want more organic traffic to your web pages, then you need to understand and
cater to Google’s algorithm. If you want more video views, then it’s all about YouTube’s
algorithm.
jQuery
jQuery is a fast, small, lightweight, cross-platform and feature-rich JavaScript library. jQuery
provides various features that makes web development very quick and easy. Some of the basic
and unique features of jQuery are listed below:
• Very fast and extensible
• Small and lightweight
• Platform-independent
• Provides cross-browser support
• Improves the performance of any application
• Write less and do more as compared to JavaScript
• Simplifies AJAX call and DOM manipulation.
JSON example:
{"students":[
{"firstName":"Ahmad", "lastName":"Raza"},
{"firstName":"M", "lastName":"Malik"}
]}
Difference between JSON and XML
1. JSON doesn’t use end tag. XML uses end tag.
2. JSON can use arrays. XML can’t use arrays.
3. JSON need only a standard JavaScript function to parse. XML needs XML parser to parse
Page | 11
Browser Functionality
The main responsibilities of a browser are as follows:
• To submit requests to web servers on the user’s behalf.
• To accept responses from web servers and produce a visual representation for the user.
• To render the results in the browser window.
• Caching: The browser must verify whether it needs to request data from the server. It may
have a cached copy of the required data item. If this cached copy has not “expired,” the
browser can eliminate an extra request for the resource.
• Authentication and authorization: A web server may require authorization for resources then
the browser must react to server requests by prompting the user for credentials.
• State maintenance: To maintain state across requests and responses, web servers may request
that the browser accept cookies. The browser must store the cookie information and make it
available. In addition, the browser should provide options to let users choose whether to accept
cookies.
• Taking actions in response to status codes: The HTTP status code may provide additional
processing instructions. These instructions may indicate a problem in accessing the resource or
may instruct the browser to redirect the request to another location.
• Rendering complex objects: Most web browsers support content types such as text/html,
text/plain, image/gif, and image/jpeg. This means that the browser provides functionality to
render objects with these contents within the browser window and without having to install
additional software. To render or play back other more complex objects (e.g., audio, video, and
multimedia), a browser must provide support for these content types.
• Dealing with error conditions: The browser must be equipped to deal with connection failures,
invalid server responses, and other similar situations.
1. User Interface – It is the space where interaction between users and the browser occurs.
2. Browser Engine – It is the piece of code that communicates the inputs of user interface with
the rendering engine.
3. Rendering Engine – It is the part responsible for displaying the requested content on the
screen. It first parses the html tags and then using the styles, it builds a render tree and finally a
render layout, which displays the content on the screen.
4.Networking – The fraction of the code written in the browser, responsible to send various
network calls. For example, sending the http requests to the server.
5. Java Script Interpreter – It is the component of the browser written to interpret the java
script code presented in a web page.
6. UI Backend – This draws basic widgets on the browser like combo boxes, windows, etc.
7. Data Storage – It is small database created on the local drive of the computer where the
browser is installed. This database stores various files like cache, cookies, etc.
Browsers Working
WWW works on the client-server model. A user computer works as a client which can receive
and send data to the server. When a web page is requested by a user, the browser contacts the
Page | 12
requested server and by fetching the requested files, it displays the web page on the computer
screen. The whole process takes place in these three steps:
1. Contact to DNS Server – When a user enters a URL into the address bar and hits ‘enter’, at first
browser contacts the DNS server. A DNS server stores the IP addresses of the server associated
with the corresponding domain names. The DNS server takes the domain name from the browser
and returns the corresponding IP address to the browser.
2. Contact to Server – After getting the IP address of the server for the requested webpage,
browser sends a request to that server for the desired files. For example, consider the following
URL: http://www.mywebsite.com/articles
3. Rendering – The entire process followed by a browser from fetching the webpage to displaying
it on the screen is called Rendering. It is executed in the following steps:
a. Loading HTML – As soon as the web page is found by the browser, it is loaded into the browser
using the http protocol. All the html tags as well as other resources (like images, pdf) referred
in the html tags are loaded separately.
b. Parsing – An HTML Parser starts interpreting the html files and building subsequent content
tree.
c. Apply Styles – Web pages may have style sheets attached and a web browser also has its
default styles. Using a CSS parser, they are interpreted to define the styles.
d. Construct Frames – Using the HTML and style sheets, the browser constructs the frames. A
frame is a rectangular block with various properties like width, height, color, spacing, etc.
e. Frames Layout– This process includes arranging all the frames to make a layout of the web
page.
f. Frames Painting– As soon as the layouts are constructed the next process is painting. Painting
is the term used for the process to exactly render the objects on the screen and after that,
the webpage is displayed on the computer screen. A browser executes all the processes in a
flash of a second.
Web Framework
A web framework is a software platform for developing web applications and websites. Web
application frameworks offer a wide range of pre-written components, code snippets, and whole
application templates. Web development frameworks can be used for the development of web
services, web APIs (Application Programming Interface) and other web resources.
There are generally two types of development frameworks – client side and server-side
frameworks.
Page | 13
Classification of Framework Architectures
1. Model-View-Controller
Most web application frameworks rely on the Model-View-Controller (MVC) architecture that is
made up of three parts:
• Model – the backend business logic and data
• View – The frontend or graphical user interface (GUI)
• Controller –Processing the request through the model and passing it back to view
2. Three-Tier Architecture
Three-tier architecture is a multilayer architecture that has three formalized layers:
• Presentation Tier
o This is the topmost level of the application.
o Provides user interface sometimes called the GUI or front-end.
o This tier is usually built on web development frameworks, such as CSS or
JavaScript.
• Application Tier
o It controls the application’s core functionality by performing detailed processing
and is usually coded in programming languages, such as PHP, ASP, and Python.
o It processes the inputs received from the clients and interacts with the database.
• Database Tier
o A database, comprising both data sets and the database management system or
RDBMS software that manages and provides access to the data (back-end).
o The data tier would be some sort of database, such as a MySQL, SQLite, or
PostgreSQL database. All of these are run on a separate database server.
Page | 14
Web Server - Basic Operation
Web servers, browsers, and proxies communicate by exchanging HTTP messages.
The server receives and interprets HTTP requests, locates and accesses requested resources, and
generates responses, which it sends back to the originators of the requests.
The Networking module is responsible for both receiving requests and transmitting responses
over the network. When it receives a request, it must first pass it to the Address Resolution
module, which is responsible for ‘pre-processing’ the request. This pre-processing includes:
1. Virtual Hosting: if this Web server is providing service for multiple domains, determine the
domain for which this request is targeted, and use the detected domain to select configuration
parameters.
2. Address Mapping: determine whether this is a request for static or dynamic content, based
on the URL path and selected server configuration parameters, and resolve the address into an
actual location within the server’s file system.
3. Authentication: if the requested resource is protected, examine authorization credentials to
see if the request is coming from an authorized user.
Once the pre-processing is complete, the request is passed to the Request Processing module,
which invokes sub-modules to serve static or dynamic content as appropriate. When the selected
sub-module completes its processing, it passes results to the Response Generation module,
which builds the response and directs it to the Networking module for transmission.
Page | 15