Spring Questions and Answers – Integrating Spring Web Flow with JSF

«
»

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Creating Beans”.

1. View Technologies to render Spring Web MVC view.
a) JSP
b) Tiles
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: By default, Spring Web Flow relies on Spring MVC view technologies (e.g., JSP and Tiles) to render its views.
advertisement

2. Submodules of Spring Web Flow to simplify use of JSF and javascript in Spring.
a) Spring Faces
b) Spring Javascript
c) None of the mentioned
d) All of the mentioned
View Answer

Answer: d
Explanation: Spring Web Flow provides two submodules, Spring Faces and Spring JavaScript, to simplify using JSF and JavaScript in Spring.

3. Spring Faces provides a set of client-side validation components for standard JSF input components.
a) True
b) False
View Answer

Answer: a
Explanation: These components are provided as Facelets tags, so you have to use Facelets as your JSF view technology to use them.

4. To use JSF Validation components provided by spring faces.
a) Faces
b) Spring Javascript
c) Facelets
d) None of the mentioned
View Answer

Answer: c
Explanation: To use the JSF validation components provided by Spring Faces, you have to use Facelets to create your JSF views.

5. Attribute used to handle web flow requests.
a) servlet-mapping
b) servlet-attr
c) servlet-flow
d) servlet-requests
View Answer

Answer: a
Explanation: If you are going to use the legacy JSF request handling at the same time, you will have to specify that.

6. JSF view handler to enable Facelets and a SpringBeanFacesELResolver to access Spring beans.
a) FaceletViewHandler
b) FaceletView
c) FaceletHandler
d) None of the mentioned
View Answer

Answer: a
Explanation: You have to configure FaceletViewHandler as the JSF view handler to enable Facelets and a SpringBeanFacesELResolver to be able to access Spring beans through JSF expression language.
advertisement

7. To resolve Facelets views we configure:-
a) ViewFacelets
b) ViewResolver
c) View-resolver
d) View_Resolver
View Answer

Answer: b
Explanation: We configure a ViewResolver to resolve Facelets views by conventions we dictate.

8. File extension of a view state’s name which is by default loaded by facelet page.
a) .xml
b) .hbm.xml
c) .xhtml
d) none of the mentioned
View Answer

Answer: c
Explanation: The JSF flow builder services internally use a JSF view factory, which will, by default, load a Facelets page using a view state’s name and .xhtml as the file extension.

9. Navigation in traditional JSF applications is handled by:-
a) linking directly linking to a resource
b) commandLink
c) invoking an action
d) all of the mentioned
View Answer

Answer: d
Explanation: Navigation in traditional JSF applications is handled by linking directly linking to a resource or by invoking an action (for example, on a commandLink).

10. For cross field validation or some sort of barrier to ensure state before you start a flow, we use.
a) FacesContext
b) FaceletContext
c) FacesResolver
d) All of the mentioned
View Answer

Answer: a
Explanation: There are many reasons to want to use the FacesContext from the action.

11. To use Spring Faces Components, we register which of the following?
a) Servlet API
b) ResourceServlet
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: b
Explanation: Before you can use the Spring Faces components, you have to register ResourceServlet, which is provided by Spring JavaScript for accessing static resources in JAR files, in the web deployment descriptor.

12. Resources retrieved by Spring Faces Component.
a) JavaScript
b) CSS
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: Spring Faces components will retrieve static JavaScript and CSS resources from Spring JavaScript through this servlet.
advertisement

13. Component which additionally provides a pop-up date picker control for its enclosed input field.
a) clientDateValidator
b) clientValidator
c) dateValidator
d) validator
View Answer

Answer: a
Explanation: The validation components enable client-side validation for the inputText components. You will see that the clientDateValidator component additionally provides a pop-up date picker control for its enclosed input field.

14. Component which encloses command button.
a) validateAll
b) validateAllClick
c) validateAllInClick
d) validateAllOnClick
View Answer

Answer: c
Explanation: When a command button enclosed by a validateAllInClick component is clicked, it will trigger all validators in the same page to validate their fields.

15. Libraries provided by RichFaces an integration support for Spring web flow.
a) RichFaces
b) Slf-4j
c) Log-4j
d) All of the mentioned
View Answer

Answer: a
Explanation: RichFaces actually provides two libraries that each serve very different purposes. One, called Ajax4JSF, provides the ability to augment existing components and page elements with Ajax functionality. The other, RichFaces, provides an advanced component set with Ajax functionality baked into the core.

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn