Unit 1 Question Bank
Unit 1 Question Bank
KOVILVENNI
16. State the use of web server logs and lists the contents of a message log.
A server log is a log file (or several files) automatically created and maintained by a server of
activity performed by it. A typical example is a web server log which maintains a history of page
requests. The W3C maintains a standard format (the Common Log Format) for web server log
files, but other proprietary formats exist. The message log is used by a number of processes to
provide debugging and troubleshooting information. You can view the message log from the
process monitor after clicking on the details hyperlink for a process and the by clicking on the
message log hyperlink in the actions area.
17. How will you create a password field in a HTML form?
<input type=”password” name=”pwd” size=15>
18. List any four common browsers.
Google Chrome
Netscape Navigator
Microsoft Internet Explorer
Mozilla Firefox
19. State the uses of internet protocol.
IP function: transfer data from source device to destination device.
IP source software creates a packet representing the data.
Header: source and destination IP addresses, length of data and other information.
20. Define tags. What are the two different types of tags?
Tags signal the browser to inform about the formatting details.ie how the content should be
displayed in the browser screen. Tags are enclosed between “<” and”>”. Standalone tag only start
tag is present and no end tag. Example <BR> and container tag have start and end tag will be
present .Example <html>…. </html>.
21. What are the rules to define a tag?
Attributes should be placed inside start tag, appears as Name-value pairs separted by blank
spaces, Attributes should have only one value, values should be enclosed within either single(‘) or
double (“) quotes.
22. Differentiate between standalone and container tag.
Standalone Container
Only start tag is present and no end tag. Both start and end tage will be present
Can have only attributes and no parameters Can have both attributes and parameters
Example: <BR> Example <html>…</html>
The style sheets are classified into three types such as inline, embedded or internal and external or
imported style sheets.
40. Explain briefly inline, internal and external style sheets.
Inline
If only a small piece of code has to be styled then inline style sheets can be used.
Embedded
Embedded style sheets are put between the <head> </head> tags.
External
If you want to apply a style to all the pages within your website by changing just one style sheet,
then external style sheets can be used.
41. Give example for inline style sheet.
<h2>InLINE CSS</h2>
<p style=”color:sienna;margin-left:20px”>
The style ATTRIBUTE we are able to modify the appearance of HTML elements </p>
42. How will you embedded the external style sheet?
In external style sheet is ideal when the style is applied to many pages. With an external style
sheet, you can change the look of an entire Web site by changing just one file. Each page must
include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags.
The style sheet file must be saved with a .css extension. An example of a style sheet file is shown
below:
"myStyle.css":
body {
background-color: lightblue;}
h1 {
color: navy;
margin-left: 20px;}
43. How will you include CSS in a web site?
Inline
Inline styles are when you just insert the type of style you want inside another tag, using the style
attribute. This is usually the least useful way to use CSS.
<p style="width:100%; color:#660099; text-align:right; background-color:#ffcc00;" >
Embedded
Styles can also be placed in the document using the <style> tag. The <style> tag is usually placed
in the head section of the document, where it will apply to the whole document.
<style> <!--
p { color:#009900;
font-family:"comic sans ms",sans-serif; }
h1 { color:#660000; font-size:12pt; }
</style>
External styles
Styles can also be set in an external style sheet which is linked to the page with a <link> tag. For
example the style sheet for this site is included like this:
<link rel="stylesheet" type="text/css" href="class.css" />
44. What is the purpose of CSS Box Model and mention its parts also.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of:
margins, borders, padding, and the actual content.
The different parts are:
CS8651 – Internet Programming Department of CSE
• Margin
• Border
• Padding
• Content
Part- B
1. Explain WWW and HTTP protocol.
WWW
The term WWW refers to the World Wide Web or simply the Web. The World Wide Web
consists of all the public Web sites connected to the Internet worldwide, including the client
devices (such as computers and cell phones) that access Web content. The WWW is just one of
many applications of the Internet and computer networks. The World Web is based on these
technologies:
1. HTML - Hypertext Markup Language
2. HTTP - Hypertext Transfer Protocol
3. Web servers and Web browsers
HTTP
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images,
sound, video, and other multimedia files) on the World Wide Web. HTTP is an application
protocol that runs on top of the TCP/IP suite of protocols. HTTP concepts include (as the
Hypertext part of the name implies) the idea that files can contain references to other files whose
selection will elicit additional transfer requests. Any Web server machine contains, in addition to
the Web page files it can serve, an HTTP daemon, a program that is designed to wait for HTTP
requests and handle them when they arrive. Your Web browser is an HTTP client, sending
requests to server machines. When the browser user enters file requests by either "opening" a
Web file (typing in a Uniform Resource Locator or URL) or clicking on a hypertext link, the
browser builds an HTTP request and sends it to the Internet Protocol address (IP address)
indicated by the URL. The HTTP daemon in the destination server machine receives the request
and sends back the requested file or files associated with the request. (A Web page often
consists of more than one file.)
2. Discuss the structure of the HTTP request message.
Structure of the request:
start line
header field(s)
blank line
optional body
Request URI
Uniform Resource Identifier (URI)
Syntax: scheme : scheme-depend-part
Ex: In http://www.example.com/ the scheme is http
Request-URI is the portion of the requested URI that follows the host name (which is supplied by
the required Host
header field)
Ex: / is Request-URI portion of http://www.example.com/
CS8651 – Internet Programming Department of CSE
Request methods:
GET
• Used if link is clicked or address typed in browser
• No body in request with GET method
POST
• Used when submit button is clicked on a form
• Form information contained in body of request
HEAD
• Requests that only header fields (no body) be returned in the response
• PUT
• DELETE
• TRACE
• OPTIONS
2. Header field structure:
– field name : field value
Syntax
– Field name is not case sensitive
– Field value may continue on multiple lines by starting continuation lines with white space
– Field values may contain MIME types, quality values, and wildcard characters (*’s)
3. MIME
– Convention for specifying content type of a message
– In HTTP, typically used to specify content type of the body of the response
– MIME content type syntax:
– top-level type / subtype
– Examples: text/html, image/jpeg
– Example header field with quality values:
accept:
text/xml,text/html;q=0.9,
text/plain;q=0.8, image/jpeg,
image/gif;q=0.2,*/*;q=0.1
– Quality value applies to all preceding items
– Higher the value, higher the preference
– Note use of wildcards to specify quality 0.1 for any MIME type not specified earlier
4. Common header fields:
– Host: host name from URL (required)
– User-Agent: type of browser sending request
– Accept: MIME types of acceptable documents
– Connection: value close tells server to close connection after single request/response
– Content-Type: MIME type of (POST) body, normally application/x-www-form-urlencoded
– Content-Length: bytes in body
Referer: URL of document containing link that supplied URI for this HTTP request
3. Discuss the structure of the HTTP Response message.
Structure of the response:
start line
header field(s)
blank line
optional body
Status line
Example: HTTP/1.1 200 OK
Three space-separated parts:
CS8651 – Internet Programming Department of CSE
HTTP Version
Status code
Reason phrase (intended for human use)
Status code
Three digit number
First digit is class of the status code
1 Informational
2 Success
3 Redirection (alternate URL is supplied)
4 Client Error
5 Server Error
– Other two digits provide additional information
• Header Fields
– Connection, Content-Type, Content-Length
– Date: date and time at which response was generated (required)
– Location: alternate URI if status is redirection
– Last-Modified: date and time the requested resource was last modified on the server
– Expires: date and time after which the client’s copy of the resource will be out-of-date
– ETag: a unique identifier for this version of the requested resource (changes if resource
changes)
• Client Caching
– A cache is a local copy of information obtained from some other source
– Most web browsers use cache to store requested resources so that subsequent requests to the
same resource will not necessarily require an HTTP request/response
• Ex: icon appearing multiple times in a Web page
• Cache advantages
– (Much) faster than HTTP request/response
– Less network traffic
– Less load on server
• Cache disadvantage
– Cached copy of resource may be invalid (inconsistent with remote version)
• Validating cached resource:
– Send HTTP HEAD request and check Last-Modified or ETag header in response
– Compare current date/time with Expires header sent in response containing resource
– If no Expires header was sent, use heuristic algorithm to estimate value for Expires
– Ex: Expires = 0.01 * (Date – Last-Modified) + Date
• Character sets
– Every document is represented by a string of integer values (code points)
– The mapping from code points to characters is defined by a character set
– Some header fields have character set values:
– Accept- Charset: request header listing character sets that the client can recognize
• Ex: accept- charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
– Content-Type: can include character set used to represent the body of the HTTP message
• Ex: Content-Type: text/html; charset=UTF-8
– Technically, many “character sets” are actually character encodings
– An encoding represents code points using variable-length byte strings
– Most common examples are Unicode-based encodings UTF-8 and UTF-16
IANA maintains complete list of Internet-recognized character sets/encodings
CS8651 – Internet Programming Department of CSE
4. Explain HTML elements and the types of lists supported by HTML in details.
HTML element
An HTML element is an individual component of an HTML document or web page, once this has
been parsed into the Document Object Model. HTML is composed of a tree of HTML elements
and other nodes, such as text nodes. Each element can have HTML attributes specified. Elements
can also have content, including other elements and text. HTML elements represent semantics, or
meaning. For example, the title element represents the title of the document.
Heading Tags
Any document starts with a heading. You can use different sizes for your headings. HTML also
has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.
While displaying any heading, browser adds one line before and one line after that heading.
Example
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
Paragraph Tag
The <p> tag offers a way to structure your text into different paragraphs. Each paragraph of text
should go in between an opening <p> and a closing </p> tag as shown below in the example:
Example
<p>Here is a first paragraph of text.</p>
Line Break Tag
Whenever you use the <br /> element, anything following it starts from the next line. This tag is
an example of an empty element, where you do not need opening and closing tags, as there is
nothing to go in between them.
Example
<p>Hello<br />
You delivered your assignment ontime.<br />
Thanks<br />
Centering Content
You can use <center> tag to put any content in the center of the page or any table cell.
Example
<center>
<p>This text is in the center.</p>
</center>
Horizontal Lines
Horizontal lines are used to visually break up sections of a document. The <hr> tag creates a line
from the current position in the document to the right margin and breaks the line accordingly.
Example
<hr />
Nonbreaking Spaces
you should use a nonbreaking space entity instead of a normal space. For example, when
coding the "12 Angry Men" in a paragraph, you should use something similar to the following
code:
Example
<p>An example of this technique appears in the movie "12 Angry Men."</p>
HTML Lists
CS8651 – Internet Programming Department of CSE
HTML offers authors several mechanisms for specifying lists of information. All lists must
contain one or more list elements.
Unordered HTML List
The first item
The second item
The third item
The fourth item
Ordered HTML List
Example
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Ordered information.
1. The first item
2. The second item
3. The third item
4. The fourth item
5. HTML Description List
Example
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
Definitions.
The first item
Description of item
The second item
Description of item
Example
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
5. Discuss the various features available in HTML to format the text with example.
Basic functionality
– Server calls on TCP software and waits for connection request to one or more ports
– When a connection request is received, the server dedicates a subtask (Single copy of
server software handling a single client connection)
CS8651-Internet Programming Department of CSE
The HTML table model allows authors to arrange data -- text, preformatted text, images, links,
forms, form fields, other tables, etc. -- into rows and columns of cells.
Each table may have an associated caption that provides a short description of the table's purpose.
A longer description may also be for the benefit of people using speech or Braille-based user
agents.
Table rows may be grouped into a head, foot, and body sections, Row groups convey additional
structural information and may be rendered by user agents in ways that emphasize this structure.
User agents may exploit the head/body/foot division to support scrolling of body sections
independently of the head and foot sections.
When long tables are printed, the head and foot information may be repeated on each page that
contains table data.
Authors may also group columns to provide additional structural information that may be
exploited by user agents.
Furthermore, authors may declare column properties at the start of a table definition in a way that
enables user agents to render the table incrementally rather than having to wait for all the table
data to arrive before rendering.
Table cells may either contain "header" information or "data. Cells may span multiple rows and
columns.
49
CS8651-Internet Programming Department of CSE
Here's a simple table that illustrates some of the features of the HTML table model. The following table
definition:
<TABLE border="1"
summary="This table gives some statistics about fruit
flies: average height and weight, and percentage
with red eyes (for both males and females).">
<CAPTION><EM>A test table with merged cells</EM></CAPTION>
<TR><TH rowspan="2"><TH colspan="2">Average
<TH rowspan="2">Red<BR>eyes
<TR><TH>height<TH>weight
<TR><TH>Males<TD>1.9<TD>0.003<TD>40%
<TR><TH>Females<TD>1.7<TD>0.002<TD>43%
</TABLE>
--------------------------------------------------------------------------------------------------------------------------------------
ii) What is the significance of using forms on the web page? Enlist various components used on form.
A webform, or HTML form on a web page allows a user to enter data that is sent to a server for processing. Forms
can resemble paper or database forms because web users fill out the forms using checkboxes, radio buttons, or text
fields. For example, forms can be used to enter shipping or credit card data to order a product, or can be used to
retrieve search results from a search engine.
Forms are enclosed in the HTML form tag. This tag specifies the communication endpoint the data entered into the
form should be submitted to, and the method of submitting the data, GET or POST.
Elements
Forms can be made up of standard graphical user interface elements:
text input — a simple text box that allows input of a single line of text (an alternative, password, is used for
security purposes, in which the character typed in are invisible or replaced by symbols such as *)
radio — a radio button
file — a file select control for uploading a file
reset — a reset button that, when activated, tells the browser to restore the values to their initial values.
submit — a button that tells the browser to take action on the form (typically to send it to a server)
textarea — much like the text input field except a textarea allows for multiple rows of data to be shown and
entered
50
CS8651-Internet Programming Department of CSE
select — a drop-down list that displays a list of items a user can select from
Example
51
CS8651-Internet Programming Department of CSE
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows="10%,80%,10%">
<frame name="top" src="/html/top_frame.htm" />
<frame name="main" src="/html/main_frame.htm" />
<frame name="bottom" src="/html/bottom_frame.htm" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
Attribute Description
src This attribute is used to give the file name that should be loaded in the
frame. Its value can be any URL. For example,
src="/html/top_frame.htm" will load an HTML file available in html
directory.
52
CS8651-Internet Programming Department of CSE
frameborder This attribute specifies whether or not the borders of that frame are
shown; it overrides the value given in the frameborder attribute on the
<frameset> tag if one is given, and this can take values either 1 (yes)
or 0 (no).
marginwidth This attribute allows you to specify the width of the space between
the left and right of the frame's borders and the frame's content. The
value is given in pixels. For example marginwidth="10".
marginheight This attribute allows you to specify the height of the space between
the top and bottom of the frame's borders and its contents. The value
is given in pixels. For example marginheight="10".
noresize By default you can resize any frame by clicking and dragging on the
borders of a frame. The noresize attribute prevents a user from being
able to resize the frame. For example noresize="noresize".
scrolling This attribute controls the appearance of the scrollbars that appear on
the frame. This takes values either "yes", "no" or "auto". For example
scrolling="no" means it should not have scroll bars.
longdesc This attribute allows you to provide a link to another page containing
a long description of the contents of the frame. For example
longdesc="framedescription.htm"
List :
HTML offers web authors three ways for specifying lists of information. All lists must contain one or more list
elements. Lists may contain:
<ul> - An unordered list. This will list items using plain bullets.
<ol> - An ordered list. This will use different schemes of numbers to list your items.
<dl> - A definition list. This arranges your items in the same way as they are arranged in a dictionary.
HTML Unordered Lists
An unordered list is a collection of related items that have no special order or sequence. This list is created by using
HTML <ul> tag. Each item in the list is marked with a bullet.
Example
53
CS8651-Internet Programming Department of CSE
<!DOCTYPE html>
<html>
<head>
<title>HTML Unordered List</title>
</head>
<body>
<ul>
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ul>
</body>
</html>
This will produce following result:
Beetroot
Ginger
Potato
Radish
The type Attribute
You can use type attribute for <ul> tag to specify the type of bullet you like. By default it is a disc. Following are the
possible options:
<ul type="square">
<ul type="disc">
<ul type="circle">
Example
Following is an example where we used <ul type="square">
<!DOCTYPE html>
<html>
<head>
<title>HTML Unordered List</title>
</head>
<body>
<ul type="square">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ul>
</body>
</html>
This will produce following result:
54
CS8651-Internet Programming Department of CSE
Beetroot
Ginger
Potato
Radish
The start Attribute
You can use start attribute for <ol> tag to specify the starting point of numbering you need. Following are the
possible options:
Example
Following is an example where we used <ol type="i" start="4" >
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type="i" start="4">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce following result:
iv. Beetroot
v. Ginger
vi. Potato
vii. Radish
8. Explain the capabilities of Web Server (APR/MAY 2013)
Basic functionality
• Server calls on TCP software and waits for connection req to one or more ports
• When a connection request is received , the server dedicates a subtask(Single copy of server
55
CS8651-Internet Programming Department of CSE
• Log information about the request and response such as IP address and the status code in a plain-
text file.
• If the TCP connection is kept alive , the server subtask continues to monitor the connection, the
client send another request or initiates a connection close.
Few Definitions
• All modern servers concurrently process multiple requests
• Multiple copies of the server running simultaneously(Concurrency)
• Subtask Single copy of server software handling a single client connection
• Virtual Host HTTP request include a host header field
• Multiple host names mapped by a DNS to a single IP address
• Web server determine which virtual host is being requested by examining the host header field.
Server Configuration and Tuning
• Modern servers have large number of Configuration parameters
• Server Configuration broken into two areas:
– External Communication
– Internal Processing
• In Tomcat two separate Java Packages:
– Coyote
– Catalina
• Coyote Provides HTTP 1.1 communication
– Catalina Actual Servlet Container
Coyote parameters affecting External Communication
IP addresses and TCP ports
Number of subtasks created when server initialized
Max number of threads allowed to exist simultaneously
Max no of TCP connection request that will be queued if server is running its max no of threads.
If queue full the received connection request is refused.
“Keep-alive” time for inactive TCP connections
• Settings of the parameter affect the performance of the server.
• Tuning the Server
– Changing the values of these and similar parameters in order to optimize performance
• Tuning is done by trial and error
• Load generation or stress test tools used to simulate request to a web server helpful for
experimenting with tuning parameters
Service has Five Components
• Connector, Host, Logger, Realm, and Valve
• Connector is a coyote component handles HTTP communication
• Clicking on the connector will produce the window containing the dropdown menus of possible
56
CS8651-Internet Programming Department of CSE
57
CS8651-Internet Programming Department of CSE
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> Transitional DTD XHTML Example </title>
</head>
59
CS8651-Internet Programming Department of CSE
• Once declaration identified, associate origin and weight with every declaration
• PERSON WHO WROTE THE DOCUMENT
• PERSON WHO IS VIEWING THE DOCUMENT
• PERSON WHO WROTE THE BROWSER SOFTWARE
Origin of a declaration is one of the following:
• Author-> declaration is part of an external or embed style sheet or part of the value specified by
style attribute
• User agent –>A browser define default style property values for HTML elements
• User-> Modern browsers allow users to provide a style sheet
Cascading order
What style will be used when there is more than one style specified for an HTML element?
all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the
highest priority:
60
CS8651-Internet Programming Department of CSE
1. Browser default
2. External style sheet
3. Internal style sheet (in the head section)
4. Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style
defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).
Note: If the link to the external style sheet is placed after the internal style sheet in HTML <head>, the
external style sheet will override the internal style sheet!
Style Inheritance
• Cascading based on structure of style sheets
• Inheritance based on tree structure of document
• What if no style declaration applies to a property of an element?
• Generally, the property value is inherited from the nearest ancestor element that has a value for the
property
• If no ancestor has a value (or the property does not inherit) then CSS defines an initial value that is used
• Property values:
o Specified: value contained in declaration
• Absolute: value can be determined without reference to context (e.g., 2cm)
• Relative: value depends on context (e.g., larger)
o Computed: browser performs calculation depends on particular relative value
o absolute representation of relative value (e.g., larger might be 1.2 x parent font size)
o Actual: value actually used by browser (e.g., computed value might be rounded)
• Most properties inherit computed value
o Exception discussed later: line-height
• A little thought can usually tell you whether a property inherits or not
o Example: height does not inherit
12. Explain any eight CSS text properties.
A font is a mapping from code points toGlyphs glyph
• font-family property can accept a list offamilies, including generic font families
61
CS8651-Internet Programming Department of CSE
62
CS8651-Internet Programming Department of CSE
LINE BOXES:
Text is rendered using line boxes
63
CS8651-Internet Programming Department of CSE
13. Explain about the various style sheets with examples. (Internal,External,Inline) (APR/MAY 2013)
1. To create an inline style
a. Add the style attribute to the HTML tag.
b. The style declaration must be enclosed within double quotation marks.
2. To create an embedded style
a. Insert a <style> tag within the head section of HTML file.
b. Within the <style> tag, enclose the style declarations need to the entire Web page.
c. The style sheet language identifies the type of style used in the document.
d. The default and the most common language is “text/css” for use with CSS.
3. To create an External styles
a. Create a text file containing style declarations
b. Create a link to that file in each page of the Web site using a <link> tag.
c. Specify the link attributes, such as href, rel, and type.
d. Link a style sheet, the value of the href attribute should be the “URL” of the linked document,
the value of the rel attribute should be “stylesheet” and the value of the type attribute should be
64
CS8651-Internet Programming Department of CSE
“text/css”.
EXTERNAL.CSS:
body{ background-color: gray;}
p { color: blue; }
h3{ color: white; }
EXTERNAL.HTML:
<html>
<head>
<link rel="stylesheet" type="text/css" href="EXTERNAL.css" /><!—Link tag for External CSS-->
</head>
<body>
<h3> A White Header </h3>
<p> This paragraph has a blue font.
The background color of this page is gray because
we changed it with CSS! </p>
</body>
</html>
INTERNAL.HTML:
<html>
<head>
<style> <!—Style tag for Internal CSS-->
body { background-color: blue; }
p { color: white; }
</style>
</head>
<body>
<h2>Internal CSS</h2>
<p>This page uses internal CSS. Using the style tag we are able to modify
the appearance of HTML elements.</p>
</body>
</html>
INLINE.HTML:
<html>
<head>
</head>
<body>
<h2>InLINE CSS</h2>
<p style="color:sienna;margin-left:20px"><!—Style Attribute(INLINE)-->
This page uses INLINE CSS. Using the style ATTRIBUTE we are able to modify
the appearance of HTML elements.
</p>
</body>
</html>
14 Difference between web browser and web server
65
CS8651-Internet Programming Department of CSE
Web server and web browser are the terms which are commonly used for website. The basic purpose of
both is to develop a platform for internet web directory. So that any users can anytime access any kind of
website. Major difference between them is on their function and how they perform their functions. Check
for the detail of both topics before understanding the differences between them.
Web Server:
Web server is a computer system, which provides the web pages via HTTP (Hypertext Transfer
Protocol). IP address and a domain name is essential for every web server. Whenever, you insert a URL
or web address into your web browser, this sends request to the web address where domain name of your
URL is already saved. Then this server collects the all information of your web page and sends to
browser, which you see in form of web page on your browser. Making a web server is not a difficult job.
You can convert your computer into a web server with the help of any server software and connecting the
computer to the internet. Lot of web server software are available in the market in shape of NCSA,
Apache, Microsoft and Netscape. Storing, processing and delivering web pages to clients is its main
function. All the communication between client (web browser) and server takes place via HTTP.
Web Browser:
Web browser is a client, program, software or tool through which we sent HTTP request to web server.
The main purpose of web browser is to locate the content on the World Wide Web and display in the
shape of web page, image, audio or video form. You can call it a client server because it contacts the web
server for desired information. If the requested data is available in the web server data then it will send
back the requested information again via web browser. Microsoft Internet Explorer, Mozilla Firefox,
Safari, Opera and Google Chrome are examples of web browser and they are more advanced than earlier
web browser because they are capable to understand the HTML, JavaScript, AJAX, etc. Now a days, web
browser for mobiles are also available, which are called microbrowser.
Difference:
Following are the differences between web server and web browser.
Web server is essential to store all information and data of websites. While web browser are used
66
CS8651-Internet Programming Department of CSE
Internet
Intranet
PCs in intranet are not available to the world outside the intranet.
Usually each company or organization has their own Intranet network and members/employees of
that company can access the computers in their intranet.
Each computer in Intranet is also identified by an IP Address which is unique among the
computers in that Intranet.
Internet is general to PCs all over the world whereas Intranet is specific to few PCs.
Internet has wider access and provides a better access to websites to large population whereas
Intranet is restricted.
Internet is not as safe as Intranet as Intranet can be safely privatized as per the need.
Real-time communication
This category consists of persistent socket connections. Flash Player supports two types of socket
connections: those that require a specific format for packets (XMLSocket) and those that allow raw
socket connections (Socket)
69
CS8651-Internet Programming Department of CSE
HTTPService
HTTPService is a component that allows you to make requests to simple HTTP services such as text
files, XML files, or scripts and pages that return dynamic data. You must always define a value for the url
property of an HTTPService object.
The following example uses MXML to create an HTTPService object that loads text from a file called
data.txt saved in the same directory as the compiled .swf file:
<mx:HTTPService id="textService" url="data.txt" />
Sending requests
Creating an HTTPService object does not automatically make the request to load the data. In order to
make the request, you must call the send( ) method. If you want to load the data when the use clicks a
button, you can call the send( ) method in response to a click event:
textService.send( );
Handling results
The send( ) method makes the request, but a response is not likely to be returned instantaneously.
Instead, the application must wait for a result event. The following example displays an alert when the
data loads:
<mx:HTTPService id="textService" url="data.txt" result="mx.controls.Alert.show('Data loaded')" />
Sending parameters
When you want to pass parameters to the service, you can use the request property of the HTTPService
instance. The request property requires an Object value. By default, the name/value pairs of the object are
converted to URL-encoded format and are sent to the service using HTTP GET.
The default value is object, which yields the default behavior you’ve already seen. You can optionally
70
CS8651-Internet Programming Department of CSE
work with SOAP-based web services. There are two ways you can work with the WebService
components: using MXML and using ActionScript. Using WebService Components with MXML
You can create a WebService component instance using MXML. When you do, you should specify an
id and a value for the wsdl property.\
Eg: <mx:WebService id="statesService" wsdl="http://www.rightactionscript.com/states/
webservice/StatesService.php?wsdl" />
Web services define one or more methods or operations. You must define the WebService instance so that
it knows about the operations using nested operation tags. The operation tag requires that you specify the
name at a minimum.
Handling results
When a web service operation returns a result, you can handle it in one of two ways: explicitly handle
the result event or use data binding. Then, once a result is returned, you can retrieve the result value from
the lastResult property of the operation.
72