31 JavaServer™ Faces Web Apps: Part 2
31.1 Introduction
No questions.
31.2 Accessing Databases in Web Applications
No questions.
31.2.1 Setting Up the Database
31.2.1 Q1: Which of the following is true?
a. You should maintain a separate database connection for each client request.
b. You should use a connection pool that allows the server to manage a limited
number of database connections and share them among requests.
c. You should never connect to databases from web apps.
d. None of the above.
31.2.2 Class AddressBean
31.2.2 Q1: The ________ annotation allows you to inject a DataSource into a managed
bean.
a. @Resource.
b. @DataSource.
c. @DataSourceDefinition.
d. None of the above.
31.2.3 index.xhtml Facelets Page
31.2.3 Q1: The ________ element displays a collection’s data in tabular format.
a. h:table.
b. h:collection.
c. h:dataTable.
d. None of the above.
31.2.4 addentry.xhtml Facelets Page
No questions.
31.3 Ajax
31.3 Q1: Ajax separates the user interaction portion of an application from its server
interaction, enabling both to proceed ________.
a. synchronously.
b. asynchronously in parallel.
c. without any interaction whatsoever.
d. None of the above.
31.3 Q2: The browser’s ________ enables the asynchronous exchanges with the web
server that make Ajax applications so responsive.
a. HttpRequestObject.
b. XMLHttpRequest object
c. XMLHttpRequestObject.
d. None of the above.
31.4 Adding Ajax Functionality to the Validation App
31.4 Q1: The f:ajax element’s ________ attribute specifies a space-separated list of
element ids—the values of these elements are submitted as part of the Ajax request.
a. execute.
b. render.
c. send.
d. display.
31.4 Q2: The f:ajax element’s ________ attribute specifies a space-separated list of
element ids for the elements that should be updated via partial page updates.
a. execute.
b. render.
c. send.
d. display.