30 Java Server Faces Web Applications
30.1 Introduction
No questions.
30.2 HyperText Transfer Protocol (HTTP) Transactions
30.2 Q1: For security reasons, the path in a URL normally represents a(n) ________ on
the server.
a. Actual directory.
b. Virtual directory.
c. File.
d. None of the above.
30.2 Q2: A ________ maintains a database of hostnames and their corresponding IP
addresses.
a. file.
b. database.
c. DNS server.
d. None of the above.
30.3 Multitier Application Architecture
30.3 Q1: The three typical tiers in a web application are ________, ________ and
________.
a. user interface tier, business logic tier, information tier.
b. browser tier, server tier, information tier.
c. client tier, middle tier, top tier.
d. None of the above.
30.4 Your First JSF Web App
30.4 Q1: Which of the following is true?
a. When you invoke a JSF app from a web browser for the first time, the browser
requests the app’s default JSF page.
b. When a web server receives a request for a JSF app, it passes the request to the
JSF web-application framework for processing.
c. The JSF framework includes the Faces servlet—a software component running on
the server that processes each requested JSF page so that the server can eventually
return a response to the client.
d. All of the above.
30.4.1 The Default index.xhtml Document: Introducing Facelets
30.4.1 Q1: Which of the following is true?
a. Facelets are a combination of XHTML markup and JSF markup.
b. XHTML combines a page’s content with its presentation.
c. You cannot dynamically insert values into a Facelets page.
d. None of the above.
30.4.2 Examining the WebTimeBean Class
30.4.2 Q1: ________ are instances of classes that follow certain conventions for class
design.
a. Properties.
b. JavaBeans objects.
c. JSF elements.
d. None of the above.
30.4.2 Q2: A JavaBean exposes its data to a JSF document as ________.
a. Properties.
b. JavaBeans objects.
c. JSF elements.
d. None of the above.
30.4.3 Building the WebTime JSF Web App in NetBeans
No questions.
30.5 Model-View-Controller Architecture of JSF Apps
30.5 Q1: ________ architecture separates application’s from the graphical presentation
and the processing logic.
a. Data-Presentation-Logic.
b. Data-View-Controller.
c. Model-View-Controller.
d. None of the above.
30.6 JSF Components
30.6 Q1: A(n) ________ arranges elements in an XTHML table containing rows with a
specified number of columns.
a. h:panelGrid.
b. h:table.
c. h:grid.
d. None of the above.
30.6 Q2: Which of the following is true?
a. An app’s images and CSS files can be placed in any folder of the app.
b. An app’s images and CSS files are placed in the app’s resources folder within
the Web Pages node.
c. An app’s images and CSS files are placed in the subfolders of the app’s
resources folder within the Web Pages node.
d. None of the above.
30.7 Validation Using Validator Components and Custom Validators
30.7 Q1: A ________ determines whether a field contains an acceptable number of
characters.
a. f:validateDoubleRange.
b. f:validateLength.
c. f:validateLongRange.
d. None of the above.
30.7 Q2: A ________ determines whether a field contains an integer value in an
acceptable range.
a. f:validateDoubleRange.
b. f:validateLength.
c. f:validateLongRange.
d. None of the above.
30.8 Session Tracking
30.7 Q1: Tracking individual clients as they visit a website is known as ________.
a. session tracking.
b. client tracking.
c. personalization.
d. None of the above.
30.8.1 Cookies
30.8.1 Q1: A cookie is ________.
a. something you eat.
b. a piece of data that maintains information about a client during and possibly
between browser sessions.
c. a piece of data that maintains information about all the servers that a client visits.
d. None of the above.
30.8.2 Session Tracking with @SessionScoped Beans
30.7.2 Q1: Which of the following is true?
a. An @RequestScoped bean can be access by all of an app’s pages during a session.
b. Sessions never expire.
c. An @SessionScoped is created when a session begins and exists throughout the
entire session.
d. None of the above.