JavaServer Faces in Action Quiz

 
By Kito Mann, March 2005  
Duke

Test what you learned from JavaServer Faces in Action, Chapter 8, which explained how to build a static Login page with JavaServer Faces and JSP technology by importing the proper tag libraries, and adding HtmlGraphicImage and HtmlOutputText components.

Choose the best answer(s) for each question, then click Submit to see how you scored.

 

  1. What of following features can _not_ be configured in the JSF configuration file?
     A. Navigation rules
     B. Managed beans
     C. Custom components
     D. Application name


  2. Which tag must enclose all other tags on a Faces JSP page?
     A. <f:faces>
     B. <f:view>
     C. <h:jsf>
     D. <h:view>


  3. Which JSF component can be used to create tables?
     A. HtmlPanelGroup
     B. HtmlTable
     C. UITable
     D. HtmlPanelGrid


  4. How do you declare a text label for an input control?
     A. Use the HtmlOutputLabel component
     B. Use the HtmlOutputLabel component with a child HtmlOutputText component
     C. Use the HtmlOutputText component
     D. Use the OutputLabel component


  5. What type of events does the HtmlCommandButton generate?
     A. Command events
     B. Submit events
     C. Action events
     D. Click events


  6. Why does the HtmlForm component render a <hidden> field?
     A. To keep track of its identifier
     B. To keep track of the components in tree
     C. To set its submitted property
     D. For JavaScript integration


  7. Which JSF expression references an application's context path?
     A. #{contextPath}
     B. #{requestContextPath}
     C. #{facesContext.externalContext.requestContextPath}
     D. ${request.contextPath}


  8. How do you integrate JSF components with custom JavaScript?
     A. Write a new renderer
     B. Through faces-config.xml
     C. With HTML pass-through attributes
     D. No specific integration is necessary


  9. How do you integrate JSF components with cascading style sheets (CSS)?
     A. With the JSF configuration file
     B. With the styleClass property
     C. With the cssClass property
     D. With the class property


  10. How do you customize validation messages with JSF?
     A. Create a resource bundle with specific keys and specify its name in faces-config.xml
     B. Create a resource bundle with specific keys
     C. Create a properties file with custom keys and specify its name in web.xml
     D. Specify the custom messages in faces-config.xml

Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner Java 8 banner (182)