This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Securing and persisting objects in Web Flows”.
1. Element which secures web flows.
a) secured
b) security
c) sec
d) none of the mentioned
View Answer
Explanation: With Spring Security configured properly, you can simply secure a flow, a state, or a transition by embedding the secured element with required access attributes specified.
2. To secure web flows with Spring Security.
a) DelegatingFilter
b) DelegatingFilterProxy
c) DelegatingProxy
d) None of the mentioned
View Answer
Explanation: To secure web flows with Spring Security, you first have to configure a DelegatingFilterProxy filter in the web deployment descriptor (i.e., web.xml).
3. Group id to add spring security using Maven.
<dependency> <groupId></groupId> <artifactId>spring-security-core</artifactId> <version>3.0.2.RELEASE</version> </dependency>
a) org.springframework.secure
b) org.springframework.security
c) org.springframework.securedflow
d) none of the mentioned
View Answer
Explanation: org.springframework.secur is used to secure web flows with Spring Security.
4. auto-config provides only default form-based login service.
a) True
b) False
View Answer
Explanation: HTTP auto-config, which provides a default form-based login service, an anonymous login service, and so on.
5. To enable Spring security for web flows.
a) SecurityFlowExecutionListener
b) SecurityFlowExecution
c) FlowSecurity
d) SecurityFlowListener
View Answer
Explanation: You have to register the flow execution listener SecurityFlowExecutionListener in the flow executor to enable Spring Security for web flow.
6. Which of the following class should replace ‘?’.
<beans ...> ... <webflow:flow-executor id="flowExecutor"> <webflow:flow-execution-listeners> <webflow:listener ref="securityFlowExecutionListener" /> </webflow:flow-execution-listeners> </webflow:flow-executor> <bean id="securityFlowExecutionListener" class="?" /> </beans>
a) org.springframework.webflow.security.SecurityFlow
b) org.springframework.webflow.SecurityFlowExecutionListener
c) org.springframework.webflow.security.SecurityFlowExecutionListener
d) org.springframework.security.SecurityFlowExecutionListener
View Answer
Explanation: You have to register the flow execution listener SecurityFlowExecutionListener in the flow executor to enable Spring Security for web flow.
7. Which attribute is used to access security element of web flow.
a) attribute
b) attributes-security
c) attributes
d) none of the mentioned
View Answer
Explanation: You can specify multiple access attributes required for accessing this web flow in the attributes attribute, separated by commas.
8. Spring web flow supports integration with.
a) JSF
b) Hibernate
c) JPA
d) All of the mentioned
View Answer
Explanation: Spring Web Flow 2.0 comes with support for JPA and Hibernate.
9. To integrate JPA with Spring Web flows.
a) JpaFlowExecutionListener
b) HibernateFlowExecutionListener
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener (e.g., JpaFlowExecutionListener for JPA.
10. To integrate Hibernate with Spring Web flows.
a) JpaFlowExecutionListener
b) HibernateFlowExecutionListener
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener (e.g., HibernateFlowExecutionListener for Hibernate.
11. HibernateFlowExecutionListener and JpaFlowExecutionListener both belongs to which of the package.
a) org.springframework.web.persistence package
b) org.springframework.persistence package
c) org.springframework.webflow package package
d) org.springframework.webflow.persistence package
View Answer
Explanation: JpaFlowExecutionListener for JPA and HibernateFlowExecutionListener for Hibernate, both of which belong to the org.springframework.webflow.persistence package) in the flow executor.
12. JpaFlowExecutionListener and Hibernate Listener binds to flow scope.
a) True
b) False
View Answer
Explanation: . When a new flow starts, this listener creates a new persistence context (e.g., a JPA entity manager or a Hibernate session) and binds it to the flow scope.
13. Libraries used to integrate Hibernate with JPA.
a) Hibernate 3
b) Hibernate 3 Entity Manager
c) JPA API
d) All of the mentioned
View Answer
Explanation: To use Hibernate as the JPA engine, you have to add Hibernate 3, the Hibernate 3 EntityManager, the JPA API, and ehcache.
14. To configure JPA vendor-specific information.
a) JPA vendor adaptor
b) Data source
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: you can configure a JPA entity manage factory by providing a data source and a JPA vendor adaptor, where you can configure JPA vendor-specific information.
15. You have to register a flow execution listener in the flow executor.
a) True
b) False
View Answer
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener in the flow executor.
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.
- Get Free Certificate of Merit in Spring
- Participate in Spring Certification Contest
- Become a Top Ranker in Spring
- Take Spring Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Apply for Spring Internship
- Buy Information Technology Books
- Buy Spring Books
- Apply for Programming Internship
- Practice Programming MCQs