Вы находитесь на странице: 1из 8

8635

Web Technology 2011


Sample Multiple Choice Exam

ID
Name

Each of the following questions has exactly one correct answer. For each question, you may select
one or more answers by marking the corresponding boxes. This means:
if you are certain which answer is correct, mark just that one;
if you are in doubt, mark those answers you think may be correct;
if you have no idea, dont mark any answers at all.
The answers are graded such that random guessing will yield a score of zero.
We use the convention that x means a selected choice, and both

and

mean not selected.

Question 1
What is Unicode?
a
b
c
d

A compressed format for storing XML documents.


Java code that can run on all platforms.
A debugger for JSP classes.
A universal character set.

Question 2
Which is a correct abbreviation of the XPath expression:
/child::foo[position()=7]/following::bar/attribute::baz
a
b
c
d
e

/foo[7]/following::bar/@baz
/foo[7]//bar/@baz
//foo[position()=7]//bar/#baz
/foo[7]//bar/#baz
//foo[position()=7]//bar/@baz

Question 3
What does <xsl:comment> do in XSLT?
a
b
c

Inserts a comment in the target document.


Denotes a comment in the stylesheet.
Skips comments in the source document.

Question 4
What is the result type of the method getChildren() from the Element class in JDOM?
a
b
c
d

org.jdom.Element
java.util.List
org.jdom.Document
java.util.Vector

Question 5
What is a tag library?
a
b
c
d

A Java library for inspecting XML documents.


A way of extending JSP with more tags.
An extension of XSLT.
A kind of XML schema.

8635

Question 6
What is DOCTYPE?
a
b
c

The output from an XSLT stylesheet.


The root class in JDOM.
A part of the DTD language.

Question 7
What may an XML schema validator do besides checking validity?
a
b
c

Insert defaults.
Indent the file.
Spell check.

Question 8
Which is not a SAX event?
a
b
c
d
e

endElement
startDocument
endDocument
startAttribute
startElement

Question 9
What does it mean that XML trees are always ordered trees?
a
b
c
d

Some trees are bigger than others.


The order in which their nodes occur is significant.
Attributes must occur in alphabetical order.
Their height is at most 5.

Question 10
In DTD, which keyword specifies that an attribute is optional?
a
b
c
d

#OPTIONAL
#FIXED
#REQUIRED
#IMPLIED

Question 11
What does <servlet-mapping> do in the web.xml deployment descriptor in Tomcat?
a
b
c
d

Maps Servlet names to class files.


Maps URLs to Servlet names.
Maps CGI parameters to their values.
Specifies the encoding of XML documents.

Question 12
Which is not a valid XPath node test?
a
b
c
d
e

node()
foo
attribute()
text()
*

Question 13
In which directory must Servlet class files be placed when using the Tomcat server?
a
b
c
d
e

myapplication/servlet/
myapplication/WEB-INF/servlet/
myapplication/
myapplication/WEB-INF/
myapplication/WEB-INF/classes/

Question 14
How are declarations denoted in JSP?
a
b
c
d

<%int x; %>
{ int x; }
<%= int x; %>
<%! int x; %>

Question 15
In which case may according to the HTTP specification a request with identical parameters be cached
by the client?
a
b
c
d

Always.
When the POST method is used.
When the GET method is used.
Never.

8635

Question 16
What is the relationship between Servlets and JSP?
a
b
c
d

JSP is translated into Servlets.


JSP has better runtime performance that Servlets.
Servlets are more secure that JSP.
Servlets are translated into JSP.

Question 17
How can you declare in DTD that the element x contains either the element a or the element b but
not both of them?
a
b
c
d

It is not possible to express in DTD.


<!ELEMENT x (a?,b?)>
<!ELEMENT x a|b>
<!ELEMENT x (a|b)>

Question 18
What is an HttpSession object used for?
a
b
c

Storing session specific data.


Synchronizing access to shared variables.
Requiring the client to enter username and password.

Question 19
Is the following well-formed XML?
<code>
int i=0;
while (i &lt; 100; i++)
printf("dWebTek is fun!);
</code>
a
b

No
Yes

Question 20
Which techniques cannot be used to encode the session id in an implementation of Servlets?
a
b
c

client side caching


URL rewriting
cookies

Question 21
Which string correctly encodes "100% pure" according to application/x-www-form-urlencoded?
a
b
c

100%25+pure
100%+pure
100+%+pure

Question 22
How are declarations denoted in JSP?
a
b
c
d

<%! int x; %>


<%= int x; %>
{ int x; }
<%int x; %>

Question 23
Which XML fragment is not well-formed?
a
b
c
d
e

<a/>
<a></a><b></b>Really?
<a>You<b>must</b>be</a>kidding?
<a>What<a foo>is this?<a></a>
<a>Now<a>what?</a></a>

Question 24
In XML Schema, what does the targetNamespace attribute denote?
a
b
c
d

The
The
The
The

namespace of the XML Schema document.


namespace of documents in the language being defined.
location of an XML Schema.
location of an XML Schema validator.

Question 25
Which is the correct way of referring to an XSLT stylesheet from an XML document?
a
b
c

<?xml-stylesheet type="text/xsl" href="mystyle.xsl"?>


<link type="text/xsl" href="mystyle.xsl"/>
<stylesheet type="text/xsl" href="mystyle.xsl"/>

8635

Question 26
A namespace declaration contains a URI that must link to what?
a
b
c
d
e

Nothing in particular.
The official W3C namespace page.
The homepage of the organization publishing the document.
The XML document itself.
The address of an XML Schema validating the document.

Question 27
What are the names of elements selected by the XPath expression //foo[.//baz[.//bar/../foo]]?
a
b
c

bar
baz
foo

Question 28
In XSLT, <xsl:sort> may be a child element of:
a
b
c
d

<xsl:sort>
<xsl:text>
<xsl:apply-templates>
<xsl:template>

Вам также может понравиться