JSP Flashcards

1
Q

An XML namespace can
Select one:
a. Declare a space in memory for a DTD
b. Ensure the XML document is well-formed
c. Allow a prefix for the element to prevent naming collisions
d. Validate XML data

A

c. Allow a prefix for the element to prevent naming collisions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A DTD can make an XML document ___________, and an XSD can make an XML document ________________.
Select one:
a. Well-formed and valid; Well-formed and valid
b. Well-formed; Well-formed (neither can make the XML valid)
c. Well-formed; Well-formed and valid
d. Well-formed and valid; Well-formed

A

c. Well-formed; Well-formed and valid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An XML schema definition does not outline ________________.
Select one:
a. Data types of elements and attributes
b. Order of child elements
c. Data validation algorithms and conditional statements
d. Elements and attributes

A

c. Data validation algorithms and conditional statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

By default, when is a servlet or a JSP first instantiated and loaded onto the Servlet Container?
Select one:
a. When the servlet container calls the init( ) method
b. When the web app starts up
c. When the main method is called
d. When it is first requested by a user.

A

d. When it is first requested by a user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can a servlet or a JSP be instantiated when the web app starts up?
Select one:
a. Overriding the init( ) method
b. Changing the deployment descriptor
c. It is like this by default
d. Using the load-on-startup tag in the web.xml

A

d. Using the load-on-startup tag in the web.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
In the following XML tag, what XML construct is "name"? trainee name="Dave" 
Select one:
a. Element
b. Attribute 
c. Root
d. Node
A

b. Attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
To handle exceptions in servlets and JSPs, you would have to use the \_\_\_\_ element in web.xml to specify the invocation of servlets in response to certain exception class types or HTTP status codes.
Select one:
a. error-handler 
b. None of the above.
c. error
d. error-page
A

a. error-handler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is not true about cookies?
Select one:
a. Browser can cache cookies indefinitely
b. Browser is expected to support 20 cookies for each Web server
c. Browser may limit cookie size to 4 KB each.
d. Browser can support 300 cookies total

A

a. Browser can cache cookies indefinitely

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is NOT true about the JSessionID?
Select one:
a. JSessionID is created by web container upon the first request and is sent along with first response to client.
b. Clients forward JSessionID with every request to identify their Session object.
c. JSessionID is a cookie in J2EE web application which is used in session tracking.
d. None of the above.

A

d. None of the above.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
What is the difference between a DTD and XSD?
Select one:
a. XSD is well-formed and valid. 
b. DTD is well-formed and valid.
c. DTD is only valid.
d. XSD is only valid.
A

a. XSD is well-formed and valid.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between a static and a dynamic include?
Select one:
a. Dynamic include can utilize parameters
b. Static include can only be used at the top of the page
c. Static include is a result of a standard action tag event
d. Dynamic include uses a directive scripting element

A

a. Dynamic include can utilize parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Which is not a JSP standard action tag?
Select one:
a. forward
b. include
c. useBean 
d. redirect
A

d. redirect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
Which is NOT a scripting element on a JSP?
Select one:
a. Directive
b. Declaration
c. Doctype 
d. Scriplet
A

c. Doctype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
Which is NOT a variable scope in JSP?
Select one:
a. session
b. context 
c. request
d. page
A

b. context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
Which is NOT a way of persisting state in a JEE application?
Select one:
a. URL rewriting 
b. WAR file
c. Session object
d. Cookies
A

b. WAR file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Which is NOT an implicit object of a JSP?
Select one:
a. request
b. out
c. config
d. page
e. application
f. session
g. exception 
h. pageConfig
i. response
A

h. pageConfig

17
Q

Which is the correct lifecycle of a JSP?
Select one:
a. Compile, Load, Instantiate, jspService, jspInit, jspDestroy
b. Translate, Compile, Load, Instantiate, jspInit, jspService, jspDestroy
c. Translate, Compile, jspInit, jspService, jspDestroy
d. Compile, Translate, Instantiate, Load, jspInit, jspService, jspDestroy

A

b. Translate, Compile, Load, Instantiate, jspInit, jspService, jspDestroy

18
Q
Which of the following is not a valid tag in the web.xml for handling errors?
Select one:
a. error-code
b. exception-type
c. url-pattern 
d. location
A

c. url-pattern

19
Q
Which tags are used to map HTTP traffic a servlet in web.xml?
Select one:
a. servlet-mapper, servlet-name, url
b. servlet-mapping, servlet-name, servlet-class
c. servlet-map, url-pattern
d. servlet-mapping, servlet-name, url-pattern
A

d. servlet-mapping, servlet-name, url-pattern

20
Q
XML is not typically used
Select one:
a. To transport and store data on internet
b. To store data for e-commerce websites
c. For database-driven web applications
d. To format and display data
A

d. To format and display data