The World Wide Web, or WWW in short, is a system of documents accessed via the internet
using standard protocols. The web should not be confused with the internet. The web is
described in the terms of protocols and document specifications maintained by the World
Wide Web consortium, or W3C in short. Those protocols and documents are clouded on the
internet. In other words, the web is a part of the internet.
Hypertext Transfer Protocol, or HTTP in short, is an application level protocol for distributed
hypermedia (text, image, video, etc) information systems, developed by the W3C. The main
purpose of HTTP is to retrieve inter-linked hypertext documents from the internet. A common
example is every day passing time on facebook. You do retrieve different types of media from
the facebook website using the HTTP protocol that's familiar to both, the web server hosting
the facebook website, and the web browser you use to access facebook website.
Some facts about HTTP:
• HTTP works in client/server architecture.
• The client is the web browser.
• The server is the web server.
• The client is referred to as the user agent.
• The server is referred to the origin server.
• HTTP is request/response protocol, i.e. user agent requests, origin server responses,
connection is closed.
• One consequence of the previous fact is that HTTP is a stateless protocol, i.e. no state
is shared between different requests.
2. W3C, founded and headed by Sir Tim Berners-Lee, credited the father of the web. See
2.1. HTTP Request
An HTTP request is sent by the user agent to a web origin after establishing a connection with
it. The purpose of an HTTP request is to retrieve some resource. The request consists of:
Request Line: the method of retrieving the resource in addition to the path to this
resource. Popular methods are GET and POST.
GET Method: parameters can be passed to resources in the URL.
POST Method: parameters can be passed to resources also, but the in the
body of the request.
Request Headers: a set of key-value attributes giving some metadata about the
2.2. HTTP Response
An HTTP response is sent by the web origin to the user agent before closing the connection
with it. The purpose of HTTP response is to reply to the user request with either the resource
or some other replies with failure or security insufficiencies. The response consists of:
Response Line: Status code (informing reply message) in addition to a textual
Response Headers: a set of key-value attributes giving some metadata about the
Resource content: the content of the requested resource.
2.3. HTTP Session
Because HTTP is a stateless protocols, stateful applications of user logins and online shop-
cards cannot be directly implemented using HTTP. That's because those type of applications
needs to remember state among a sequence of requests. To meet this requirement, the
concept of HTTP session was introduced.
An HTTP session is a set of HTTP requests. The main purpose of a session is to remember
state about the client among those requests. This supports all types of applications that
needs to make a conversation with the client. An HTTP session is supported by browser-
cookies. A browser-cookie is some state that can be stored by the origin server on the
user agent and retrieved on later requests. It lets the server remembers some state about
a sequence of requests for a specific client. In other words, browser-cookies are variables
inside the browser accessed by some origin server. Browser-cookies have expiration-dates
that determines the timeout of the HTTP session.
Hypertext Markup Language, or HTML in short, is a standard language for representing
structural documents of different types of media (text, image, video, etc), developed by the
W3C. The main purpose of HTML is to describe the hierarchical structure of a hypermedia
page that needs to be rendered using some type of applications called web browsers.
Some facts about HTML:
• HTML is a representational language, not a programming language.
• HTML is rendered using a web browser.
• HTML does not do actions. However, scripts of actions can be embedded in some
4. Web Server
A web server is an application that supports hypermedia distribution over the internet. It
implements the HTTP protocol and manages different media resources to provide it to users
on request. The most popular web server is Apache Web Server. It's open source and can be
downloaded from (http://www.apache.org).
5. Web Browser
A web browser is an application that used to access and view hypermedia resources
managed by some web server using HTTP protocol. It requests resource documents from
a web server and render those documents to the viewer. Most popular web browsers are
Microsoft Internet Explorer and Mozilla Firefox.
6. The Dark Age
Not too long ago, websites was just static HTML pages linked together with no activity with
the user. The user is allowed only to view static resources, lazily manually updated by the
website administrator. The web was no more just static resources. This feature changed a lot
as today websites gradually tended to be web applications.
7. The Dynamic Age
Today, most websites are interactive. Users can interact with websites in forms of
comments, edits, shares, uploads, etc. For example, the content of the facebook homepage
is dynamically changeed every time you visit it as it fetches latest posts by all of your friends.
Those types of resources cannot be built in static HTML pages and needs server-side scripting
technologies like PHP, ASP, or Servlets and JSP as we will be involved in Java EE.
8.1. HTML Skeleton
<!-- This is the header section, not displayed on screen -->
<title>Page Title Here</title>
<!-- This is the body section, displayed on screen -->
8.2. HTML Registration Form
<h1>Student Registration Form</h1>
<!-- This is the form section -->
<form action="process.jsp" method="POST">
Student Name:<input type="textfield" name="student_name"/>
Training Course:<input type="textfield"
<input type="submit" value="Register"/>
8.3. HTTP Request
Internet Explorer <request: http://www.yahoo.com/abc/foo.html>
GET /abc/foo.html HTTP/1.1
User-Agent: MSIE 6.0
8.4. HTTP Response
Web Server <response>
HTTP/1.1 200 OK
<!-- Page content goes here -->
8.5. Dynamic Page (JSP)
8.5.1. JSP Page
<title>First JSP Page</title>
int x = 5 ;
int y = 7 ;
int z = x + y ;