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