Java Spring Multiple Choice Questions & Answers (MCQs) 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
Answer: c
Clarification: By default, Spring Web Flow relies on Spring MVC view technologies (e.g., JSP and Tiles) to render its views.
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
Answer: d
Clarification: 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
Answer: a
Clarification: 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
Answer: c
Clarification: 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
Answer: a
Clarification: 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
Answer: a
Clarification: 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.
7. To resolve Facelets views we configure:-
a) ViewFacelets
b) ViewResolver
c) View-resolver
d) View_Resolver
Answer: b
Clarification: 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
Answer: c
Clarification: 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
Answer: d
Clarification: 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
Answer: a
Clarification: 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
Answer: b
Clarification: 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
Answer: c
Clarification: Spring Faces components will retrieve static JavaScript and CSS resources from Spring JavaScript through this servlet.
13. Component which additionally provides a pop-up date picker control for its enclosed input field.
a) clientDateValidator
b) clientValidator
c) dateValidator
d) validator
Answer: a
Clarification: 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
Answer: c
Clarification: 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
Answer: a
Clarification: 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.
