Quiz!

Multiple Choice

  1. What is the difference between an Action and an ActionForm?
    1. Actions must reside in the actions package, while ActionForms must reside in the forms package.
    2. Actions respond to requests, while ActionForms represent the data of a user-input form.
    3. Actions require no explicit superclass, but ActionForms must derive from org.apache.struts.actions.ActionForm.
    4. All of the above
  2. What is the difference between forwarding and redirecting?
    1. Redirecting requires that objects be stored at session scope, while forwarding allows for request-scoped objects.
    2. Redirecting is faster than forwarding.
    3. Redirected requests are subject to the "replayed request" problem, while forwarded request are not.
    4. All of the above.
  3. Which of the following statement(s) are true regarding the JSP Standard Tag Library (JSTL)?
    1. JSTL is a drop-in replacement for the Struts HTML tag library.
    2. In version 1.0 of Struts, applications were forbidden to use JSTL and thus were required to use the Struts HTML tags.
    3. Struts applications can use either JSTL, the Struts HTML tag library or both.
    4. Both a and b above.
  4. Which of the following statement(s) are true regarding the Struts Validation Framework?
    1. The Validation Framework provides pre-built validators for numeric ranges, dates and email addresses.
    2. To use the Validation Framework, you must write an XML file that configures it.
    3. The Validation Framework requires the use of the Java Authentication and Authorization Service (JAAS).
    4. Both a and b above.
  5. Which of the following statement(s) are true regarding the Struts Validation Framework?
    1. The Validation Framework provides client-side, server-side and database-tier validation.
    2. The Validation Framework provides client-side, server-side and business-logic-tier validation.
    3. The Validation Framework provides client-side and server-side validation.
    4. None of the above.
  6. How might a Struts Action class handle exceptions?
    1. Using standard Java exception handling with try-catch blocks or by using Struts declarative exception handling.
    2. Using standard Java exception handling with try-catch blocks or by using reverse-notation exception handling.
    3. Using declarative exception handling or reverse-notation exception handling.
    4. None of the above.
  7. What is the primary purpose of the "action-mapping" object returned by a Struts action's "execute()" method?
    1. The mapping object controls the order in which the Struts controller invokes plugins.
    2. The mapping object indicates how the Struts controller should redirect or forward the request.
    3. The mapping object configures the Struts Validation framework.
    4. All of the above.
  8. What is the primary benefit of writing using a "dyna form" class?
    1. Dyna forms save you from writing tedious classes that contain little more than "get/set" methods.
    2. Dyna forms have no benefit since they were deprecated in Struts 1.1.
    3. Dyna forms save you from writing tedious JDBC connection code.
    4. All of the above.
  9. What are the difference(s) between using the Struts Validation Framework and programmatic validation?
    1. The Validation Framework works at compile time, while programmatic validation occurs at runtime.
    2. The Validation Framework is deprecated, while programmatic validation is still supported in Struts 1.1.
    3. The Validation Framework saves you from writing tedious validation code for common validation scenarios.
    4. All of the above.
  10. Which statement(s) are true regarding the "mask" validator?
    1. The "mask" validator uses regular expressions to determine if a given input string is acceptable.
    2. The IDE provides a wizard that makes it easy to write the mask patterns.
    3. The "mask" validator is always used in conjunction with the "range" validator.
    4. All of the above.
  11. Which statement most accurately represents the order of scopes in Java Web application programming, from least global to most global?
    1. Page, response, request, application.
    2. Page, request, session, application.
    3. Application, page, request, session.
    4. Response, request, session, application, page.
  12. What is the primary benefit of using "Global Forwarding" in the Struts configuration file?
    1. Global forwarding is more efficient at runtime than local forwarding.
    2. Global forwarding saves typing and makes maintenance easier because it lets you define commonly used forwards in one place.
    3. Global forwarding can either forward or redirect, while local forwarding cannot redirect.
    4. All of the above.