16 Introduction to Dynamic Web Pages

waisttherapeuticΛογισμικό & κατασκευή λογ/κού

4 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

91 εμφανίσεις


Question Bank


Computer & Information Technology for HKCEE

1


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

16

Introduction to Dynamic Web Pages


(P03C16L01Q0
01
)

Which of the following is the common feature of

script
s
, applet
s

and servlet
s
?

A.

They are t
he software needed to process SGML documents
.

B.

They are o
nline games for people involved in the Internet
.

C.

They are t
ext editors
.

D.

They are s
mall programs that run inside another program
.

Answer

D


(P03C16L01Q0
02
)

Which of the following

are the functions of servlet
s
?

(1)

A
dd multimedia effects to web pages.

(2)

D
isplay mathematical notation
s

and content
s

on
the
W
eb.

(3)

I
ncorporate interactivity into web pages.

A.

(1) and (2) only

B.

(1) and (3) only

C.

(2) and (3) only

D.

(1), (2) and (3)

Answer

B


(P03C16L01Q0
03
)

Which of the following statements about a dynamic web page is/are correct?

(1)

A dynamic web pa
ge creates each page separately by writing the HTML codes.

(2)

A dynamic web page requires the creation of a general template first.

(3)

The web page content of a dynamic web page is determined before the client

s
request.

A.

(1) only

B.

(2) only

C.

(1) an
d (3) only

D.

(2) and (3) only

Answer

B


(P03C16L01Q0
04
)

Which of the following comparison between client
-
side and server
-
side dynamic web

Question Bank


Computer & Information Technology for HKCEE

2


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

page
s

is/are correct?

(1)

S
erver
-
side dynamic web page
s

ha
ve

a higher accessibility to server resources
than
c
lient
-
s
ide dynamic web page
s
.

(2)

C
lient
-
side dynamic web page
s

need extra time to download instruction codes in

addition to HTML codes while
server
-
side dynamic web page
s

do not.

(3)

C
lient
-
side dynamic web page
s

need to cater
for browser differences while
serve
r
-
side dynamic web page
s

do not.

A.

(2) only

B.

(1) and (3) only

C.

(2) and (3) only

D.

(1), (2) and (3)

Answer

C


(P03C16L01Q0
05
)

Which of the following is/are client
-
side processing technology?

(1)

PHP

(2)

JavaScript

(3)

Common Gateway Interface

A.

(2) o
nly

B.

(1) and (2) only

C.

(1) and (3) only

D.

(1), (2) and (3)

Answer

A


(P03C16L01Q0
06
)

Which of the following statements about dynamic web pages is/are correct?

(1)

They
provide more personalized contents to individual users than static web
pages.

(2)

T
hey are suitable for the web sites which need regular updates.

(3)

The
y

are created in web server
s

only.

A.

(1) only

B.

(1) and (2) only

C.

(2) and (3) only

D.

(1), (2) and (3)

Answer

B


Question Bank


Computer & Information Technology for HKCEE

3


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006


(P03C16L01Q0
07
)

Which of the following statements about Active Server

Pages is/are correct?

(1)

It is a server
-
side scripting language.

(2)

It relies on Java Applets to create web pages.

(3)

Instruction files should be downloaded before loading Active Server Pages.

A.

(1) only

B.

(3) only

C.

(1) and (2) only

D.

(2) and (3)
only

Answer

A


(P03C16L03Q00
1
)

Danny plans to publish a web site about digital cameras. Th
e site is o
n membership
basis. He decides to divide the site into 3 sections:

1.

Sample images posted by members

2.

A forum
for

members
to
share comments on various d
igital cameras

3.

A chat room for members to communicate
with
each other

Henry suggests
that
Danny write
s

static web pages.

(a)

(i)

Draw a sc
hematic diagram to explain how ‘static web pages’

work.

(4
marks)


(ii)

State
two

d
rawbacks of Henry’s suggestion.

(2 marks)

Danny finally decides

to write dynamic web pages instead of static ones.

(b)

(i)

Briefly explain the ter
m ‘dynamic web pages’
.
(1 mark)


(ii)

Name
two

types of ‘dynamic web pages’
.

(2 marks)

(iii)

Which type of
‘dynamic web pages’

should he use?
Explain
your answer
briefly.

(4 marks)

(iv)

Sugge
st suitable programming languages for Danny to write the dynamic
web pages.

(2 marks)


Question Bank


Computer & Information Technology for HKCEE

4


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

Answer

(a)

(i)





client computer

web server

1.

Client requests the
web pages.

2.

Web server looks
for corresponding
HTML files.

3.

HTML files are
sent back to client.

4.

Client browser
formats HTML files.


(ii)

W
eb pages cannot
be
update
d

instantly after sample imag
es are posted
by
members. /
M
embers’ comments cannot be posted on the forum instantly. /
Static web pages fail to provide instan
t communication function. (Any
two

or

other

reasonable answers)

(b)

(i)

Dynamic web pa
ges contain contents generated ‘
on
-
the
-
fly


by the serve
r or
the client computer according to the client’s request.


(i
i)

Client
-
side dynamic web page
s

and
server
-
side dynamic web page
s


(iii)

Use server
-
side dynamic web page
s

for sample images posting and the
fo
rum section because it enables

easier access

for

the
clients

to
the image
s

and
the
forum database. Use client
-
side dynamic web page
s

for the chat
room
.

It is
because
the content in a chat room of each client depends on
client

s input.

(iv)

Sample images posting and the forum sections: JavaScript
/ VBSc
ript / Java
Applets (Any
one
)



Chat room: ASP / JSP / CGI / PHP (Any
one
)


(P03C16L03Q002)

Flora uses a search engine to explor
e

the
information

of
the word

c
omputer

. The
following shows the search results of the engine.


Question Bank


Computer & Information Technology for HKCEE

5


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006


(a)

(i)

State whether the sear
ch engine is a type of static web pages or dynamic
web pages
. Explain your answer briefly.

(3 marks)

(ii)

Draw a schematic diagram to explain how the search engine works.

(5
marks)

(iii)

Sugge
st a suitable programming language for the search engine.

(1 mar
k)

Patrick is a web programmer of a department store. He needs to upgrade the company
web site s
o that
customer
s

can buy
products through the Internet. Before upgrading,
the web site contains static web pages.

(b)

(i)

How was the web site maintained before

upgrading

and
after

upgrading?

(4
marks)

(ii)

Compare the workload on the web server
before and after
upgrading.
Explain briefly.

(2 marks)

Answer

(a)

(i)

Dynamic web pages. The search results are not determined until
a

user
ente
rs the keywords and click
s the ‘
Search


button. This cannot be achieved
by static web pages, as the web server cannot know when the user
will
search the keywords.

(ii)



Question Bank


Computer & Information Technology for HKCEE

6


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006




client computer

web server

1.

Client transmits
keyword to web
server.

2.

Web server looks for
HTML files and
instruction files
.

3.

HTML codes
and
instruction
return
to client.

5.

Client browser
displays web pages.

4.

Client browser
proces
s
instruction
codes and
HTML
codes.





(iii)

JavaScript

(b)

(i)

Before upgrading, adding new content means creating
new separate web
pages. Any changes in the structure require manual update of each page.


After upgrading, new content is inserted into the structure
d

template. Any
changes to the structure mean updating the template only.

(ii)

The workload on the web serv
er increase
s after
upgrading. Dynamic pages
are created on
-
the
-
fly with
the

use of additional software.


(P03C16L03
Q0
03)

Franky put
s

the following codes into his own HTML:

<script language=
"
text/JavaScript
"
>

alert(
"
Hello!
"
)

</script>

(a)

What scripting la
nguage has been used in the above codes?

(1

mark
)

(b)

Write down
one

advantage of using the above language to write dynamic web
pages.

(1

mark
)

(c)

State the other
two

functions of the codes written in the above language.

(2
marks
)

(d)

Describe the
respons
e

of the web browser when executing the above program.

(2
marks
)

(e)

Do the above codes belong to client
-
side processing or server
-
side processing?

(1
mark
)

(f)

Write down
two

advantage
s

and
two

disadvantage
s

of using client
-
side
processing.

(4
marks
)

(g)

Write down
one

example of client
-
side processing and server
-
side processing
respectively.

(
Exclude the scripting language stated in part (a).
)

(2
marks
)

Someone suggests that Franky should add
<
noscript
>

tag to the web page.


Question Bank


Computer & Information Technology for HKCEE

7


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

(h)

Write down the function of
<noscript
>

tag.

(2
marks
)

Answer

(a)

JavaScript

(b)

Cross
-
platform
ing
.

(c)

Counter of number of visitor

/
lanter
n

(d)

A window
displayed the word
‘Hello!’ will be
opened

by the web browser.

(e)

Client
-
si
d
e processing


(f)

Advantage
s
:

The response time is s
hort
er and

t
h
e workload of the server is l
ow
er
.


Disadvantage
s
:

The security
level
is lower

and

t
he
available
function
s

are

few
er
.


(g)

Client
-
side
: VBScript

Server
-
side
: Cgi, Asp, P
hp

(A
ny one)

(h)

To display
specifi
ed

error messages
for

web browser
s

whi
ch do not support
the
<script>

tag.


(P03C16L03Q004)


The following web page has used
AJAX

technology. When user
s

drag and drop the
red frame, the frame will be moved to different places.



















(a)

AJAX

is a type of dynamic web page technology
. Except AJAX, write down
two

types of dynamic web page elements which can be found
in
the above web page.

(2
marks
)

(b)

Comparing with static web pages, write down
two
advantages and
one


Question Bank


Computer & Information Technology for HKCEE

8


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

disadvantage of using dynamic web page
s
.

(3
marks
)

(c)

Describe the

principles of AJAX, and state the advantage of using AJAX to build
up web pages.

(5
marks
)

(d)

Except the above example, write down
one

application example of AJAX
technology.

(2
marks
)

(e)

If
user
s

click the
link
‘S
ign in
’ at the right top corner, what w
ill happen?

(1
mark
)

(f)

The above web page is a type of personal portal. Except the function provided in
the above figure, write down two functions provided by
the
personal portal.

(2
marks
)

Answer

(a)

Text field (which is used to search web sites

/
input

ZIP
c
ode) /
the
clock


(b)

Advantage
s
:

Increase interactivity

and enrich

t
he contents of the presentation
.


Disadvantage:

Additional knowledge about web site programming is required
when writing web pages.


(c)

AJAX

uses asynchronous communication to comm
unicate with the server.


The information can be updated without reloading the whole layout.


The communication between the client comp
uter and the server is
carried out

through JavaScript. There is no extra time
required to

reload the whole page
as

requi
red by
traditional web page

to
send
a

form
.


Advan
tage:

AJAX

can update part of the
section

of
a

web page without updating
the whole web page. Hence, the refreshing rate can be speeded up and the traffic
volume of the network can be reduced.



(d)

Google

Map

/ Gmail

(e)

A new window
will

be opened to allow user
s

to enter the
ir

name and password.


(f)

Blog

/
stock price enquiry

/
fortune telling



(P03C16L03Q00
5
)


ASP

is a type of ‘server
-
side processing’
script
.

(a)

Write down the full name of ASP.

(1
mar
k
)

(b)

Describe the principle of ‘server
-
side processing’.

(3
marks
)

(c)

Under the normal circumstances, how do ‘s
erver
-
side processing’
script
s

collect
data from

users?

(2
marks
)

(d)

Under the normal circumstances, the server uses in ‘server
-
side processi
ng’ can
be used
as a

web server. What other kind of server can it
be
use
d

as
?

(1
mark
)

(e)

Except

ASP,
write the other
two

examples of ‘server
-
side processing’ languages.

(2
marks
)

(f)

Why is ‘server
-
side processing’ safer than ‘client
-
side processing’?
(2

marks
)

(g)

Which type of processing should be used in the each of the following cases,

Question Bank


Computer & Information Technology for HKCEE

9


(
Second Edition
)

Module

D


© Pearson Education Asia Limited 2006

‘server
-
side processing’ or ‘client
-
side processing’? Why?
(4 marks)


(i)

Authenticat
e

the identity of users when they log in the web pages.


(ii)

Perform validity chec
k for the forms filled in by the users.


Answer

(a)

Active Server Page
s

(b)

The ‘server
-
side processing’ web pages are constructed in
web
servers.

When
users request to view
a

web page,
web

server
s

will search the related HTML
documents and it is responsib
le for processing the instructions.


Then, the server will construct the required web page according to the
instructions.

(c)

Forms in
web pa
ges are used to collect
data.

(d)

Database server

(e)

PHP, CGI, JSP

(f)

U
sers cannot view the source code of the ‘
server
-
side processing’
script
. They
can only view the HTML
codes created by the
script
.


(g)

(i)

Server
-
side processing
:

When
users
log in, the user
s
’ computer needs to
communicate with the information stored in the
server

s
database.

(ii)

Client
-
side pro
cessing
:

This can b
e processed in a higher speed.